Question PSC-LOOP-0005
EasyWhat will be the output of the following pseudocode?
Integer n = 0
while (n < 20)
n = n + 6
end while
Print n
- A.
24
- B.
30
- C.
Show answer and explanation
Answer: A
n takes the values 6, 12, 18, 24; the loop stops once n is no longer less than 20.