C Programming | C Program to Check Whether a Number is Prime or Not

preview_player
Показать описание
#cprogramming #shorts
C Program to Check Whether a Number is Prime or Not

If n is perfectly divisible by i, n is not a prime number. In this case, flag is set to 1, and the loop is terminated using the break statement.

Notice that we have initialized flag as 0 during the start of our program.

So, if n is a prime number after the loop, flag will still be 0. However, if n is a non-prime number, flag will be 1.
Рекомендации по теме
Комментарии
Автор

This is the code that chatgpt gives, lol

Dhana
visit shbcf.ru