Question PSC-LOOP-0029
EasyWhat is the output of this pseudocode?
Integer n = 9045, s = 0
while (n > 0)
s = s + n mod 10
n = n / 10
end while
Print s
- A.
13
- B.
9045
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Loops question
What is the output of this pseudocode?
Integer n = 9045, s = 0
while (n > 0)
s = s + n mod 10
n = n / 10
end while
Print s
13
9045
Sign up free to see the answer and a step-by-step explanation.
9
18