frank din wrote:This second nested loop does not print anything out.
what do you mean by nested loop, i don't see any nested loop, there are two different loops 1.while loop 2. do while loop, both works differently in this case inside while loop there is another do while loop.
results are according to your code is 3 \t and 0 \t. if i am not wrong there is no more code after this code which you had mentioned in the forum, if that is the code only then it is correct code but you have asked about inner do while loop which is inside while loop had no println statement to print, if you add System.out.println(x); after the code x-=2;then it prints 18,14 .... till 6 and check the while condition to (x>5) and 4<5 so it become false and statement continues the rest of codes that is x-- is execuited and println statement prints the x value
I wasn't selected to go to mars. This tiny ad got in ahead of me: