Question PSC-LOOP-0003
EasyWhat will be the output of the following pseudocode?
Integer count = 0
for (each i from 1 to 10)
if (i mod 3 == 0)
count = count + 1
end if
end for
Print count
- A.
3
- B.
10
- C.
Show answer and explanation
Answer: A
Multiples of 3 between 1 and 10: 3, 6 and 9.