You are here : Home >> Infosys Archive >> Infosys Pseudo Codes Questions
Q. Find the number of ‘*’ in output screen (take input = 25) : [2021]
Read input
Repeat while input>0
If (input>0 and input<=10)
Write*
Else if(input>10 and input<=20)
Write**
Else if(input >20 and input<=30)
Write ***
End if
input --
End while
A. 50
B. 60
C. 40
D. 45
(d)
Explanation : Stars in first condition : 10
Stars in second condition : 20 (10*2)
Stars in third condition : 15 (5*3)
You are here : Home >> Infosys Archive >> Infosys Pseudo Codes Questions
Q. Find the output of following pseudo code :
Set a=6, b=3, c=2
if(b>a && a>c && c>b)
b = a+1
else
a = b+1
print a+b+c
a. 11
b. 9
c. 5
d. Run time error
(b)
Explanation : Let’s check out the if condition => if(3>6 and 6>2 and 2>3) is False. So code inside else will be taken into account.
a = b+1 => a = 4
Now, a+b+c => 4 + 3 + 2 => 9
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