Question PSC-LOOP-0021
HardWhat will be the output of the following pseudocode?
Integer s = 0
for (each i from 1 to 100)
if (i mod 3 == 0 OR i mod 5 == 0)
s = s + i
end if
end for
Print s
- A.
2318
- B.
2418
- C.
Sign up free to see the answer and a step-by-step explanation.