I tried to consider above stated ideas....and impleamented the following code...
But still get the same result...
int test; // for Number of test cases.
long unsigned int a,b,i,c; // a first number, b second limit
scanf("%lu%lu",&a,&b); //we have to find prime numbers between a and b
c=0; //putting c=0 number is prime else not
if(a<2 || ( !(a%2) && a!=2) )
a++; //if a is 1 or (even but not 2) increment by 1
if(b==2) //if upper limit is 2, don't print 3
for(i=3;i<=( (a/2)+ 1);i+=2)
if(!(a%i)) //for loop is chekcing for prime upto (a/2)+1
printf("%lu\n",a); //print if c==0 else continue.
Help me, Waiting for Replies...
Where am I slow?? This code is teasing my mind.