
Set Integer Emp_no=101Set Integer salary=0while (Emp_no=501)
salary=salary+100
display salary
end-while
Question 1
Answer
Question 1
What will happen when the following pseudocode is executed?
A. Code executes successfully and value of salary is displayed once.
B. Code executes successfully and nothing is displayed.
C. Code executes successfully and value of salary is displayed infinite number of times.
D. Compile time error.
Answer
Answer: C
Set Integer res=0do
--res
display res
res++
while(res>=0)
end do-while
Question 2
Answer
Question 2
What will happen when the following pseudocode is executed?
A. Code will run infinite number of times.
B. The program will not enter the loop.
C. Code will execute and value of res will be displayed twice.
D. Code will execute and value of res will be displayed once.
Answer
Answer: A
for m = 0 to 4 step 1 dofor n=0 to 4 step 1 do
display '#'end-forif(m==2) then dobreakend-ifend-for
Question 3
Answer
Question 3
How many times will ‘#’ be displayed?
A. 15
B. 1
C. 2
D. 8
Answer
Answer: A
for i=0 to 4 step 1 do
If i==i++ + --i then do
display i
end-ifend-for
Question 4
Answer
Question 4
What will be the output of the following pseudocode?
A. 0
B. 3
C. 1
D. 2
Answer
Answer: A
Set Character c='7'switch(c)
case '1': display "One"case '7': display "Seven"case '2': display "Two"default: display "Hello"break
end-switch
Question 5
Answer
Question 5
What will be the output of the following pseudocode?
A. SevenTwoHello
B. OneHello
C. SevenTwo
D. Seven
Answer
Answer: A
Also Checkout: TCS NQT Sample Question Paper

A car company carried out a survey on the twenty five new cars being sold at a dealer’s showroom in order to check if the cars were installed with air conditioning, music player and power windows. Following are some points that were accumulated over the survey.
a) 15 cars had air conditioning.
b) 2 cars had air conditioning and power windows but no music player.
c) 12 cars had music player
d) 6 cars had air conditioning and music player but no power windows were present
e) 11 cars had power windows
f) 1 car had music player and power windows but no air conditioning
g) 3 cars had all the three things installed
Question 1
Answer
Question 1
1.How many cars have none of the things installed?
a) Four
b) Three
c) Two
d) One
Answer
ANS: TWO
Question 2
Answer
Question 2
How many cars have only one of the three things installed?
a) Ten
b) Eleven
c) Twelve
d) Thirteen
Answer
ANS: Eleven
Alpha, Beta, Gamma, Delta, Epsilon and Zeta are friends. Out of them, two are housewives, one lecturer, one architect, one accountant and a lawyer. Two marries couples also exist in the group of friends. The lawyer is married to Delta who is a housewife. None of the ladies of the group is an architect or an accountant. Gamma, the accountant is married to Zeta who is a lecturer. Alpha is married to Delta. Epsilon is not a housewife.
Question 3
Answer
Question 3
What is the profession of Epsilon?
a) Accountant
b) Lawyer
c) Lecturer
d) Architect
Answer
ANS: Architect
Question 4
Answer
Question 4
How many of the group are males?
a) 1
b) 2
c) 3
d) 4
Answer
ANS: 3
Also Checkout