Correct Answer : D
In this program, sum
is initialised to 23
and i
is initialized to 2
. i
is incremented after every completion of the inner loop of j
. j
starts from 7
and goes up to 9
. At the end of the program, sum
gets the value of 45
. Note that we are not adding the value to the sum
, but simply initializing it. Since the max value of i
will be 5
and j
will be 9
, i * j
will be 45
and that is assigned to sum
.
The answer is D.