Join Regular Classroom : Visit ClassroomTech

Infosys Sample Question Paper III | Codewindow.in

Q1: What will be the output of following pseudocode?

set Character c="7"
switch(c)
    case"1":display "One"
    case"7":display "Seven"
    case"2":display "Two"
    default:display "Hello"
        break
end-switch

a) SevenTwoHello
b) OneHello
c) SevenTwo
d) Seven

Answer: a) SevenTwoHello

Explanation:
As there are no break statements, all the display messages starting from “Seven” will be printed.

Q2: What will be the output of following pseudocode?

set integer Emp_no = 101
Set integer salary = 0
while(Emp_no = 501)
	salary = salary + 100
	display salary
end-while

a) Compile time error
b) Code execute successfully and nothing is displayed
c) Code execute successfully and value of salary is displayed once
d) Code execute successfully and value of salary is displayed infinite number of times.

Answer: d) Code execute successfully and value of salary is displayed infinite number of times.

Explanation:
while condition “Emp_no = 501” always returns true.

Q3: How many times will ‘a’ be displayed?

for m=0 to 4 step 1 do
	for n=0 to 4 step 1 do
		display 'a'
	end-for
	if(m==2) then do
		break
	end-if
end-for

a) 15
b) 1
c) 2
d) 8

Answer: a) 15

Explanation:
display ‘a’ will be executed for m=0, 1 and 2 [5 times each]. Then for the if condition the loop will break.

Q4: What will be the output of following pseudocode?

for i=0 to 4 step 1 do
	if i==i++ + -i then do
		display i
	end-if
end-for

a) 2
b) 1
c) 0
d) 3

Also Read: Infosys Sample Question Paper II | Codewindow.in

Answer:

Q5: Which number should replace the question mark in the series: 14, 17, 23, 29, ?

a) 39
b) 40
c) 38
d) 43

Answer: c) 38

Q6: The missing number in the sequence: 25, 36, 49, 7, 81 is___

a) 60
b) 72
c) 64
d) 68

Answer: c) 64

Q7: If X/X+X=33, X+Y/Y=31 then X/Y=?

a) 21
b) 12
c) 16
d) 18

Answer:

Q8: If sum of digits of a number 3Q6 is 9 then Q is___

a) Three
b) zero
c) One
d) Two

Answer: b) zero


Follow Us

You Missed

Also Checkout