GlobalEdge Previous Years Solved Sample Placement Papers
-
The break statement causes an exit:
A) From the innermost loop only.
B) Only from the innermost switch.
C) From all loops & switches.
D) From the innermost loop or switch.
Ans: D) From the innermost loop or switch. -
Within a switch statement:
A)
continue
can be used butbreak
cannot be used.B)
continue
cannot be used butbreak
can be used.C) Both
continue
andbreak
can be used.D) Neither
Ans: B)continue
norbreak
can be used.continue
cannot be used butbreak
can be used. -
It is possible to declare as a friend:
A) A member function.
B) A global function.
C) A class.
D) All of the above.
Ans: D) All of the above. -
A library function
exit()
causes an exit from:A) The loop in which it occurs.
B) The block in which it occurs.
C) The function in which it occurs.
D) The program in which it occurs.
Ans: D) The program in which it occurs. -
Which of the following statement is valid?
A) We can create new C++ operators.
B) We can change the precedence of the C++ operators.
C) We can change the associativity of the C++ operators.
D) We cannot change operator templates.
Ans: D) We cannot change operator templates. -
Which of the following statements is correct?
- A reference is not a constant pointer.
- A reference is automatically de-referenced.
A) Only 1 is correct.
B) Only 2 is correct.
C) Both 1 and 2 are correct.
D) Both 1 and 2 are incorrect.
Ans: B) Only 2 is correct. -
Which of the following statements is correct?
A) Once a reference variable has been defined to refer to a particular variable it can refer to any other variable.
B) A reference is indicated by using
&&
operator.C) Once a reference variable has been defined to refer to a particular variable it cannot refer to any other variable.
D) A reference can be declared beforehand and initialized later.
Ans: C) Once a reference variable has been defined to refer to a particular variable it cannot refer to any other variable.