Correct Answer : A
Inside main
is a for
loop with the following conditions:
Initialization condition: i = 2
Terminating condition: i <= 5
Increment Value: 1 (i++
)
Inside this loop, there is another for
loop with:
Initialization condition: j = 7
Terminating condition: j <= 9
Increment Value: 1 (j++
)
Inside this loop is a display statement which prints values of i
and j
. Total number of iterations = 4 * 3 = 12.
First j
loop iterates 3
times from 7
to 9
and then i
increments. So for values of i
from 2
to 5
, the values of j
from 7
to 9
will be printed.