Prime number upto 100 by R4R Team

Prime number:
-A number that only divisible by the 1 or by itself is known as prime number.

Example-

prime numbers:
2,3,5,7,11,13,.......

Not prime numbers:
4,8,9,10,.....

-Here we show the all possible prime number between the 0 and 100

program-

#include < stdio.h>
int prime(int n)
{
for(int i=2;i< n-1;i++)
{
if(n%i==0)
return 0;
}
return 1;
}
int main()
{
int i=0;
printf("Prime number between 0 to 100\n");
for(i=2;i< 100;i++)
{
if(prime(i))
printf("%d,",i);
}
}


output-

Prime number between 0 to 100
2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!