62. C Program To find all the Prime Numbers Between 1 to 99.
How does this program work?
- This Program is used to find all the prime numbers between 1 to 99.
Here is the code
#include <stdio.h>
int main(void)
{
int i, Number, count;
printf(" Prime Number from 1 to 99 are: \n");
for(Number = 1; Number <= 99; Number++)
{
count = 0;
//Conditon to check number divisible by 2 or not
for (i = 2; i <= Number/2; i++ )
{
if(Number%i == 0)
{
count++;
break;
}
}
if(count == 0 && Number != 1 )
{
printf(" %d ", Number);
}
}
return 0;
}