Question PSC-LOOP-0056
MediumWhat does the following pseudocode print?
Integer n = 153, s = 0, d, t
t = n
while (t > 0)
d = t mod 10
s = s + d * d * d
t = t / 10
end while
if (s == n)
Print "Armstrong"
else
Print s
end if
- A.
Not Armstrong
- B.
153
- C.
Sign up free to see the answer and a step-by-step explanation.