# Virtusa C/C++ placement paper

## Virtusa C/C++ placement paper

1. What is the range of any 8 bit signed no.?

A. 0 to 255

B. -255 to 254

C. -128 to 127

D. 0 to 515

2. Consider the following statements and accordingly tell the output of these programs:

integer x = 34.54, y = 20, z = -5

print ( y > 50 AND z > 10 or x > 30)

A. 1

B. -1

C. 10

D. 0

3. Disha designs a program which can print the product of the cubes of numbers 1 – 10 (First 10 natural numbers)

This is the program:

Integer x = 0 // Statement 1

Integer sum = 0 // Statement 2

While ( x < 10) // Statement 3

{

Sum = x*x*x // Statement 4

x = x + 1 // Statement 5

}

Print sum // Statement 6

Is her program totally correct? If not where does the problem lie?

A. No error in the program

B. Statement 1

C. Statement 6

D. Statement 4

4. There is a problem which inputs a number n. This problem has a unique property that given you can solve this problem for (n-1) you can easily solve it for n. Which technique would apply best in such a case?

A. Recursion

B. Object Oriented Programming

C. Iteration

D. Decision Making

5. In which area of a class are function and data directly accessible, even outside the class?

A. Private

B. Protected

C. Public

D. None

6. In programming, if a tree’s depth is 3 levels determine the size of that Tree?

A. 4

B. 8

C. 2

D. 6

7. You are to add three matrices of order N X N. What will be the time complexity?

A. O(N x N x N)

B. O x N

C. O x N x N

D. None

8. Determine the option which is a form of access and is commonly used in addition and removal of nodes from a dedicated queue.

A. FIFO

B. LIFO

C. Both

D. None

9. x = 40

y = 35

z = 20

w = 10

If these are the values assigned, comment of output of these two statements.

Statement 1: print x * y / z – w

Statement 2: print x * y / (z – w)

A. Output will change by 80

B. Change by 160

C. Change by 50

D. Will remain the same

10. Choose the correct postfix notation for this infix notation:

((A + B)* C – (D – E)) ∧ (F + G))

A. AB + C* DE -- FG +∧

B. AB + C D*E -- FG +∧

C. A+ BC* DE - FG- +∧

D. AB + C* DE - FG -+∧