Search:

Type: Posts; User: jps

Search: Search took 0.09 seconds.

  1. Replies
    7
    Views
    1,562

    Re: Trial Division Loop Problem

    Seems to be a syntax error on this line:
    System.out.println("Prime number: "min);
    I assume that was related to transferring the code to the forum since you said the program prints, and obviously...
  2. Replies
    7
    Views
    1,562

    Re: Trial Division Loop Problem

    Nice. Does it work? This looks like a good place to do a println(indexOfTheLoop) just to make sure it prints 99900, 99901, 99902, ..., 99999 before moving on.



    Nice. Does this part work? Yet...
  3. Replies
    7
    Views
    1,562

    Re: Trial Division Loop Problem

    The direct answer to the question is no.
    What I wrote up is pseudo code. That line would refer to the portion of your code where you set a for loop to run from 99900 to 99999, where Min=99900 and...
  4. Replies
    7
    Views
    1,562

    Re: Trial Division Loop Problem

    Sort the problem out into steps.


    from m=Min to Max
    test m for prime
    if m is found to not be prime during tests, stop testing m and move to m+1
    otherwise all tests failed, m...
Results 1 to 4 of 4