And it is only printing out:
I don't exactly understand why it is not starting the for loop again how that I have updated b & e?
Junilu Lacar wrote:What was the desired output of this program?
This makes me guess you didn't write that piece of code...
Where did you take it from ? Looks like it is an example from a tutorial or handbook aimed to make the reader understand how iteration in java (for, while and do .. while) works
Based on the users question below, I assumed user expected loop control to be reset to 0 when i hits 8 (in fact during the first iteration). By changing assignment on line 5 to i = 0 program would satisfy quote below. Is it what OP expects? I'm not that sure.
Junilu Lacar wrote:Maybe I'm missing something but what exactly is the desired behavior?
By the way, my advice earlier to use while loop wasn't accurate. As wrote above, you can achieve that by amending assignment at line 5. But, as Junilu rightly said, you should define the expected output after program gets executed.
R Pats wrote:I don't exactly understand why it is not starting the for loop again how that I have updated b & e?