Printing 30 prime numbers after 500000.

Code:

`public class JNemesis`

{

public static void main(String[] Me)

{

int x,y;

y > 50;

for ( x = 0; x < 50; x++ )

{

if ( y % x == 0 )

System.out.println(x);

}

}

}

I have to use either a for or while loop. any help will be highly appreciated. Thank you in advance. :(happy):

Re: Printing 30 prime numbers after 500000.

Happypanda, you have a lot of mistakes there, you need to read some java basics. Anyhow heres an example

PrimeNumber.java

Re: Printing 30 prime numbers after 500000.

Quote:

Originally Posted by

**Happypanda** I have to use either a for or while loop. any help will be highly appreciated. Thank you in advance. :(happy):

Help with what? You don't say what's wrong.