Compare Iterations Statements For and While - Java Quiz Question


Compare the following programs ForSample1, ForSample2 and WhileSample


A
Output of all the three programs is same.
B
Output of ForSample1 and ForSample2 is same, but they are different from WhileSample.
C
Output of ForSample2 and WhileSample is same, but they are different from ForSample1.
D
ForSample2 does not compile since there is no code before first semicolon and no code after second semicolon.