Question PSC-OPS-0060
MediumWhat will be printed by the following pseudocode?
Integer total = 0, i
for (each i from 1 to 10)
total = total + (i mod 3 == 0 ? i : 0)
end for
Print total
- A.
3
- B.
55
- C.
Sign up free to see the answer and a step-by-step explanation.