Neo
Pages
Home
C
Sunday, April 22, 2018
Print 1 to 100 Prime Numbers in C Programming
#Print 1 to 100 Prime Numbers in C Programming
#include <stdio.h>
int main(void)
{
for(int i=1;i<100;i++)
{
for(int j=2;j<i;j++)
{
if(i%j==0)
break;
else if(i==j+1)
printf("%d\n",i);
}
}
return 0;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment