91. Ravi is writing a program in C++. C++ uses the 'for' keyword for loops. Due to distraction, Ravi writes 'gor' instead of 'for'. What will this result to?
Answer:
Explanation:Here is no explanation for this answer
Workspace
TCS NQT TCS Ninja TCS Digital
92. A for-loop is used for which of the following purposes?
Answer:
Explanation:Here is no explanation for this answer
Workspace
TCS NQT TCS Ninja TCS Digital
93. Tarun wants to write a code to divide two numbers. He wants to warn the user and terminate the program if he or she enters 0 as the divisor. Which programming construct can he use to do this?
Answer:
Explanation:Here is no explanation for this answer
Workspace
TCS NQT TCS Ninja TCS Digital
94. Ravi and Rupali are asked to write a program to sum the rows of a 2X2 matrices stored in the array A.
Ravi writes the following code (Code A):
for n = 0 to 1
sumRow1[n] = A[n][1] + A[n][2] end
Rupali writes the following code (Code B):
sumRow1[0] = A[0][1] + A[0][2]
sumRow1[1] = A[1][1] + A[1][2]
Comment upon these codes (Assume no loop-unrolling done by compiler):
Answer:
Explanation:Here is no explanation for this answer
Workspace
TCS NQT TCS Ninja TCS Digital
95. If the Arithmetic mean is 34 and geometric mean is 16 then what is greates number in that series of numbers?
Answer: 64
Explanation:Lets assume two numbers be x, y;
Arthmetic mean=34=>( x+y)/2=34
=> x+y=68
geometric mean=16=>(xy)^(1/2) = 16
=> xy=16*16=256
By trail and error 16*16=64*4
And 64+4/2=34
So the greatest number int that series is 64.
Workspace
TCS Digital TCS NQT