Question PSC-LOOP-0028
EasyWhat does the following pseudocode print?
Integer n = 123, r = 0
while (n > 0)
r = r * 10 + n mod 10
n = n / 10
end while
Print r
- A.
0
- B.
6
- 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 does the following pseudocode print?
Integer n = 123, r = 0
while (n > 0)
r = r * 10 + n mod 10
n = n / 10
end while
Print r
0
6
Sign up free to see the answer and a step-by-step explanation.
123
321