Question PSC-LOOP-0008
EasyWhat will be the output of the following pseudocode?
Integer c = 0
for (each i from 1 to 4)
for (each j from 1 to 3)
c = c + 1
end for
end for
Print c
- A.
7
- B.
4
- C.
Show answer and explanation
Answer: C
The inner statement runs 3 times for each of the 4 outer iterations: 12.