Question PSC-LOOP-0020
HardWhat will be the output of the following pseudocode?
Integer k = 1, p = 0
while (k * k <= 50)
p = p + 1
k = k + 1
end while
Print p
- A.
8
- B.
7
- 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 k = 1, p = 0
while (k * k <= 50)
p = p + 1
k = k + 1
end while
Print p
8
7
Sign up free to see the answer and a step-by-step explanation.
6
50