Search:

Type: Posts; User: pbrockway2

Search: Search took 0.21 seconds.

  1. Replies
    7
    Views
    1,169

    Re: Need help people please help!!

    Try it and see. Better yet guess first: what do you think i%j will yield if j is 1? And how will that affect the numbers you report as prime.

    Personally I don't regard 1 as prime, but if you...
  2. Replies
    7
    Views
    1,169

    Re: Need help people please help!!

    if(i == j){
    output.println(" "+i);}
    }


    We can be quite sure that won't print a "1" because j has just gone through a for loop where it was set to 2 and made to increment.

    Prime number -...
  3. Replies
    7
    Views
    1,169

    Re: Need help people please help!!

    If you want someone to suggest why the code you're using doesn't output 1, then you'll have to post the code you're using...

    Also note that 1 isn't a prime number.
Results 1 to 3 of 3