Question PSC-LOOP-0013
MediumWhat will be the output of the following pseudocode?
Integer x = 2
for (each i from 1 to 4)
if (i mod 2 == 1)
x = x + i
else
x = x * i
end if
end for
Print x
- A.
40
- B.
36
- C.
Sign up free to see the answer and a step-by-step explanation.