Code:
#include<stdio.h>
int main()
{
int x,y;
for(y=1;y<=1000;y=y+1){
x=y;
if(x==1 || x==2 || x==3 || x==5 || x==7 || x==11)
{printf("\nprime%d",x);}
else if(x%2==0 || x%3==0 || x%5==0 || x%7==0 || x%11==0)
{printf("\nnot prime%d",x);}
else
{
printf("\nprime%d",x);
}
}
}
this program should start from 1 and then print all numbers and define the properties(prime or not) of that number.But the number is starting from 704(or something) But not from 1.
if i start it from 1 and end before 100 it works fine..
i have debugged it.no problem shown.
IT all works fine.
but what is the problem with the output?why it starts from 700???
please compile and debug it.
thanks