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
2. ______ is not an operator overloaded by the C++ language.
A. <<.
B. +.
C. pow
D. >>.
3. correct example of a binary operator is _______.
A. —
B. +
C. ++
D. Dereferencing operator(*)
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
5. ____ is a correct example of a unary operator.
A. /
B. —
C. &
D. ==
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
7. Ternary operator is shown as _____.
A. ===
B. &&
C. ?:
D. |||
8. Overloading the addition (+) operator is correct function name OF :
A. operator(+).
B. operator_+.
C. operator+.
D. operator:+.
9. Choose the output of the following C++ code?
A. Error
B. 4 + i6
C. Segmentation fault
D. 2 + i2
10. ________ operators cannot be overloaded?
A. The [ ] operator.
B. The -> operator.
C. The . operator.
D. The & operator
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
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)
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
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
OOP MCQs
- OOP intro & examples MCQs
- Classes and Inheritance MCQs
- Friend Function MCQs
- Virtual Function MCQs
- Polymorphism MCQs
- Polymorphism MCQs 2
- Operator overloading MCQs
- Object Oriented Programming MCQs – Very Important
Programming C Plus Plus MCQs Homepage
- Low-level and high-level languages MCQs
- Procedural and non Procedural languages MCQs
- C++ STANDARD LIBRARY MCQs
- Array MCQs
- Arrays MCQs 2
- Pointers Solved MCQs
- Inline Function MCQs – C++
- Top 50 Programming C++ MCQs
- MCQs of introduction to programming
- Past Papers 2022 C++ MCQs
- Past Papers 2021 C++ MCQs
- Past Papers 2020 C++ MCQs
- Past Papers 2019 C++ MCQs
- Highly Recommended C++ Important MCQs with Explanation
- OOP
- OOP intro & examples MCQs
- Classes and Inheritance MCQs
- Friend Function MCQs
- Virtual Function MCQs
- Polymorphism MCQs
- Polymorphism MCQs 2