Program to print all prime numbers between 100 to 10000 or whatever given range.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
class prime { public static void main() { int i,j,k; for(i=101;i<10000l;i++) //here you can give your own range { k=; for(j=2;j<i;j++) { if(i%j==) k++; } if(k==) System.out.print(i+" "); } } } |

#### OUTPUT:

Tags: bluej program to find the prime numbers between 100 to 1000, prime numbers for a given range.