Search:

Type: Posts; User: GregBrannon

Search: Search took 0.10 seconds.

  1. Replies
    11
    Views
    1,082

    [SOLVED] Re: Continue and break statements

    Then it seems the only way to satisfy all of the requirements you've been given is to add an i++ statement to be executed before the continue statement, like:
    if (i == 3)
    {
    i++;
    continue;
    }...
  2. Replies
    11
    Views
    1,082

    [SOLVED] Re: Continue and break statements

    Are you interpreting the instructions in post #3 as requiring i to be initialized to 1, or do you have other instructions that specifically say i must be initialized to 1? If the former, I don't...
  3. Replies
    11
    Views
    1,082

    [SOLVED] Re: Continue and break statements

    I think that means you haven't figured it out. The path to a solution is understanding or finding the answer to the question I asked. You seem to have figured it out, at least you have experienced...
  4. Replies
    11
    Views
    1,082

    [SOLVED] Re: Continue and break statements

    Okay, the requirement wasn't clear.

    In either of your original while( true ) loops, when will the index, i, be incremented?
  5. Replies
    11
    Views
    1,082

    [SOLVED] Re: Continue and break statements

    One wonders why you just didn't program it as:
    while( i < 6 )
    {
    if (i != 3)
    {
    System.out.println(i);
    }
    i++;
    }
Results 1 to 5 of 5