Operator overloading Solved MCQ’s (OOP)

Last modified on September 12th, 2020 Download This Tutorial in PDF

Operator overloading Solved MCQ’s (OOP)

Let us see the important Operator overloading Solved MCQ’s. Operator overloading is a very important topic of object-oriented programming (OOP).

1. we can define a binary operator as :
A. The operator that performs its action on two operand
B. The operator that performs its action on three operand
C. The operator that performs its action on any number of operands
D. The operator that performs its action on a single operand

Answer - Click Here:
A

2. ______ is not an operator overloaded by the C++ language.
A. <<.
B. +.
C. pow
D. >>.

Answer - Click Here:
C

3. correct example of a binary operator is _______.
A. —
B. +
C. ++
D. Dereferencing operator(*)

Answer - Click Here:
B

4. true about streams is ______.
a. a sequence of bytes
b. an ordered sequence
c. bytes can go through the stream simultaneously
d. Bytes will go out at last that enters first into the stream
A. A only
B. A and B
C. C only
D. A and D

Answer - Click Here:
B

5. ____ is a correct example of a unary operator.
A. /
B. —
C. &
D. ==

Answer - Click Here:
B

6. when we use an operator on user-defined class objects, operator overloading:
A. always be used must
B. never be used must
C. with three exceptions must never be used
D. with three exceptions must always be used

Answer - Click Here:
D

7. Ternary operator is shown as _____.
A. ===
B. &&
C. ?:
D. |||

Answer - Click Here:
C

8. Overloading the addition (+) operator is correct function name OF :
A. operator(+).
B. operator_+.
C. operator+.
D. operator:+.

Answer - Click Here:
A

9. Choose the output of the following C++ code?

A. Error
B. 4 + i6
C. Segmentation fault
D. 2 + i2

Answer - Click Here:
A

10. ________ operators cannot be overloaded?
A. The [ ] operator.
B. The -> operator.
C. The . operator.
D. The & operator

Answer - Click Here:
C

11.What will be the output of the following C++ code?

A. Segmentation fault
B. Complex Number: 4 + i6(ANS)
C. Complex Number: 2 + i2
D. Error

Answer - Click Here:
B

12. Choose the correct statement which is false baout the operator.
A. Overloading cannot change how an operator works on built-in types.
B. New operators can never be created.
C. The precedence of an operator cannot be changed by overloading.
D. operators can change the number of arguments Certain overloaded they take.(ANS)

Answer - Click Here:
D

13. The output of the following C++ code will be _____.

A. Error
B. Segmentation fault
C. Complex Number: 4 + i6
D. Complex Number: 2 + i2

Answer - Click Here:
A

14. To implicitly overload the += operator:
A. Only the = operator needs to be overloaded.
B. Only the + operator needs to be overloaded.
C. The += operator cannot be overloaded implicitly.
D. Both the + and = operators need to be overloaded

Answer - Click Here:
C

Computer Science Repeated MCQs Book Download

Subscribe for Friendship

Prof. Fazal Rehman Shamil
Latest posts by Prof. Fazal Rehman Shamil (see all)