hello, following is the program for finding prime number it also prints about other number are prime number or not. if you want to print only prime numbers just remove last printf statement of the program.and "is a prime number" in previous printf statement.
i does not found your source now but yesterday i see it and there is a
"&" in printf statement in while loop.
int check, i, x,y,m;
printf("enter the number upto which check");
for(m=2; m<=check; m++)
printf("%d is prime number\n",m);
else printf("%d is not a prime number\n",m);