Write a C program that display all prime numbers from 1 to 100?

Answers (1)

void main()
{
int x,y=1;

while(y<=100)
{ x=2; while(x<=y)
{ if(y%x==0)
break;
x++; }
if(x==y)
printf("\n%d",y);
y++;
}

Votes: +0 / -0