So m getting a runtime eroor ...can ayone help me what am i doing wrong????http://ideone.com/m2k9e6
Please post your code inline using code tags.
here it is :
int main() { int i,j,k,ctr,m,n,ch; scanf("%d",&ch); for(i=1;i<=ch;i++) { scanf("%d%d",&m,&n); for(j=m+1;j<n;j++) { ctr=0; for(k=2;k<=j/2;j++) { if(j%k==0) { ctr=1; break; } } if(ctr==0) printf("%d\n",j); } printf("\n"); } return 0; }
for(k=2;k<=j/2;j++)