for(i=lower;i<=upper;i++){ if(i<2) continue; for(int j=2;j<i;j++) { if(i%j==0) break; } if(j==i) printf("%d ",i);}