Question PSC-LOOP-0058
MediumWhat will be the output of the following pseudocode?
Integer i, s = 0
for (each i from 10 down to 1 step 3)
s = s + i
end for
Print s
- A.
21
- B.
55
- 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 will be the output of the following pseudocode?
Integer i, s = 0
for (each i from 10 down to 1 step 3)
s = s + i
end for
Print s
21
55
Sign up free to see the answer and a step-by-step explanation.
22
19