Multiple Choice Questions in C++ (Set-XI)

Multiple Choice Questions in C++




Multiple choice questions in C++ (With answers)

101. The following operators cannot be overloaded
a) scope resolution operator
b) size of operator
c) conditional operator
d) all of the above

102. The operator definition precedes with the keyword class
a) class
b) operator
c) overload
d) none of the above

103. The operator function
a) is declared in the public section of the class
b) may be a member function or a friend function
c) both (a) & (b)
d) none of the above

104. The operator functions may be invoked
a) implicitly
b) explicitly
c) both (a) & (b)
d) none of the above

105. The following operator can’t be overloaded
a) unary
b) binary
c) ternary
d) none of the above

106. Which of the following statements regarding operator overloading function is false?
a) While overloading, the semantics of an operator cannot be changed.
b) The operator precedence cannot be changed while overloading.
c) The overloaded operator must have at least one operand that is of user-defined type.
d) You can create new operator symbol.

107. The following operators cannot be overloaded.
a) Logical AND (&&)
b) Subscript operator ([])
c) Equality operator (==)
d) none of the above

108. A unary operator when overloaded takes
a) no operand
b) one operand
c) two operands
d) none of the above]

109. The no of arguments required when overloading through friend functions is
a) Zero
b) One
c) Two
d) None of the above

110. Which of the following statements regarding operator overloading is false?
a) friend function cannot be used to overload certain operators.
b) Unary operators overloaded by means of friend functions takes no argument
c) Binary operators must explicitly return a value
d) The syntax rules of the operators cannot be overridden.




Solution Set to Multiple Choice Questions

(101)      D          (102)      B          (103)      C          (104)      C

(105)      C          (106)      D          (107)      D          (108)      B

(109)      C          (110)      B         



You cannot copy content of this page.