I changed the code to what fred has advised. What I wanted to understand is how did I have the output as to my first post. Now after changing the code I have this output:
First Loop x is 1 y is 1
SecondLoop x is 2 y is 1
First Loop x is 2 y is 2
SecondLoop x is 3 y is 2
When the inner loop is entered, the value of y is changed from 1 to 2. The condition that I have below resulted true-so the "continue first;" statement is executed. will it go to the label "first" right away? or will it
test the "while( y <= 2 )" first before letting it go back to the label "first"?
Try this way when if condition if( y == 2 ) succeed , next line executed is while( x <= 2 ) before moving to first.
it skip the condition of while( y <= 2 )
If you set while( x < 2 ) after continue there will be no more output
What do you mean it'll skip the condition of "while( y <= 2 )"? If it's going to skip the condition while, therefore the loop will not finish because of the "continue label" that has the capability to skip over the statements.