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;
}...
Type: Posts; User: GregBrannon
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;
}...
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...
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...
Okay, the requirement wasn't clear.
In either of your original while( true ) loops, when will the index, i, be incremented?
One wonders why you just didn't program it as:
while( i < 6 )
{
if (i != 3)
{
System.out.println(i);
}
i++;
}