Answer options: a. Prints: 0001 b. Prints: 012 c. Prints: 012012 d. Prints: 012345 e. Prints: 001122 f. Prints: 1112 g. Prints: 111222 h. Prints: 121212 i. Run-time error j. Compile-time error k. None of the above
Answer is h. Could anyone please explain this to me?
Thanks!
(got rid of smiley in code portion) [ October 16, 2004: Message edited by: Barry Gaunt ]
do{}while(A) loop will iterate one more time than while(A){} loop. so in this case, the inside for loop will iterate 3 times. For each inside for loop iteration, the output is 12, so the final output is 121212