You are here : Home >> Infosys Archive >> Infosys Pseudo Codes Questions
Q. Predict the output of the given pseudo code : [2021]
int x
set x = 888
if(x == 0)
print "1"
else if(x mod 9==0)
print "9"
else print (x mod 9)
end if
A. 1
B. 3
C. 9
D. 6
Ans. D
Explanation : Since x = 888
Checking conditions one by one :
if (x == 0) // condition is false (888 != 0)
else if( x mod 9 == 0) // condition is false 6 ! = 0
else print( x mod 9) // gives 6
You are here : Home >> Infosys Archive >> Infosys Pseudo Codes Questions
Q. Which of these statement regarding the pseudocode given below is correct ? [2021]
Integer x, y, z, a
Set x=2, y=1, z=5
a=(x AND y) OR (z+1)
Print a
A. 1
B. 2
C. 5
D. 0
Ans. A
Explanation :
x AND y = 1
1 OR (z+1) = 1
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