C Program To Check Whether a Given Number is Prime Number or Not, using While Loop

preview_player
Показать описание

Lets write a C program to check whether user input number is prime number or not, using while loop.

Prime Number: Any natural number which is greater than 1 and has only two factors i.e., 1 and the number itself is called a prime number.

All the numbers are perfectly divisible by number 1, so we initialize the variable count to 2. So our c program starts checking for divisibility from number 2.

C Programming Interview / Viva Q&A List

C Programming: Beginner To Advance To Expert
Рекомендации по теме
Комментарии
Автор

sir what is the purpose of flag in c program coz my teacher make this program in a different way so thats why m confused can u plz guide me

umerkhan-kvgd
Автор

Thank you soo Much, I've passed my ICT because of this

maynardcempron
Автор

Can i write directly like thus?
while(count<=num/2)

magmagaming
Автор

How about inputting 5 numbers and then print only the prime numbers?? Can you pls help me

applepen
Автор

bhai print and scan wale ko bhi loop me leke kro.

priyankanegi
visit shbcf.ru