posted 24 years ago
for i=0 to 2, j can have values 0 and 1 only.
for i=0, j=0 so inner loop breaks and control goes to next i.
i.e. i=1, then again inner loop goes for j=0 and 1.
for i=1, j=0 , condition not satisfied , print i=1, j=0.
next j=1, condition satisfied, go to outer loop for next i.
i.e. i=2,
for i=2, j=0, condition satisfied, print i=2, j=0.
next j=1, condition satisfied, print 1=2, j=1.
inner loop condition false (j<2) as j becomes 2 now.
go to outer loop incrementing i to 3.
outer loop condition also false (i<3). program stops.
From the above three answers :
1) i=1,j=0 2) i=2,j=0 3) 1=2,j=1.
1) and 3) are given as choice and hence a) and d) are the options to be selected.
Pls. give any remarks if any.
with love and happy christmas and new year wishes
Bye