You are here : Home >> Infosys Archive >> Infosys Pseudo Codes Questions
Q. Find the output of following pseudo code (take number = 6) : [2021]
Read number
K=2
i=2
while i<=number
k=k*i
i=i+1
end while
write k
A. 1440.0
B. 1700.0
C. 1560.0
D. 1340.0
(d)
Explanation : Loop will execute 5 times i.e from i = 2 to i = 6
For i = 2, k = 4
For i = 3, k = 12
For i = 4, k = 48
For i = 5, k = 240
For i = 6, k = 1440
For i = 7, condition becomes false.
You are here : Home >> Infosys Archive >> Infosys Pseudo Codes Questions
Q. Find the output of following pseudo code (take number = 35) : [2021]
Read n
i= 0
While n%10!=0
n=n+3
i++
end while
n=n+i
write n
A. 50
B. 55
C. 53
D. 45
(b)
Explanation : Loop will execute for n = 35, 38, 41, 44, 47, 50
Making i = 5
So, 50+5 = 55
I LOVE COG, JUST AWESOME CONTENT.
I think its ans is – C1 and C2 and NOT c4
correct ans is b
what they are provided as a answer of this question 18 as d is wrong answer…….
Correct answer is c
here 16. option b is the answer