posted 23 years ago
Hi Greg,
Option b is i=0, j=1
In the first iteration, value of i & j are 0 & 0. The code says,
The "outer" label is at the beginning of outer loop. So the further iterations of the inner loop are skipped, i is assigned the value 1, and the iteration proceeds.
So, the values given in option b are incorrect.
If continue statement was present without any label, or if the label was placed at the beginning of the inner loop(both are equivalent), then option b would have been one of the correct options.
Although they may seem very easy on the first glance, codes concerned with flow control are very tricky, and it is a good idea to go through each iteration one by one, to be absolutely sure of the answer.
I hope this clears your doubt. Any comments are welcome.
Prasanna.