C++ Programming Multiple Choice Question - Overloading

This section focuses on the "Overloading" in C++ programming langauge. These Multiple Choice Questions (MCQ) should be practiced to improve the C++ programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

1. Which is the correct statement anout operator overloading in C++?.

A. Only arithmetic operators can be overloaded
B. Associativity and precedence of operators does not change
C. Precedence of operators are changed after overlaoding
D. Only non-arithmetic operators can be overloaded

View Answer


2. Which of the following operators cannot be overloaded?

A. .* (Pointer-to-member Operator )
B. :: (Scope Resolution Operator)
C. .* (Pointer-to-member Operator )
D. All of the above

View Answer


3. While overloading binary operators using member function, it requires ___ argument?

A. 2
B. 1
C. 0
D. 3

View Answer


4. Which of the following operators should be preferred to overload as a global function rather than a member method?

A. Postfix ++
B. Comparison Operator
C. Insertion Operator <<
D. prefix ++

View Answer


5. Which of the following operator functions cannot be global, i.e., must be a member function.

A. new
B. delete
C. Converstion Operator
D. All of the above

View Answer


6. Which of the following is correct option?

A. x = 5, y = 10
B. x = 10, y = 5
C. Compile Error
D. x = 5, y = 5

View Answer


7. Which of the following is correct option?

A. x = 15, y = 3
B. x = 3, y = 15
C. Compile Error
D. x = 15, y = 15

View Answer


8. Which of the following is correct option?

A. lets(int) called
B. lets(lfc 2) called
C. Compiler Error: Ambiguous call to lets()
D. No error and No output

View Answer


9. Which of the following is the correct order involves in the process of operator overloading. i) Define the operator function to implement the required operations. ii) Create a class that defines the data type that is to be used in the overloading operation. iii) Declare the operator function op() in the public part of the class.

A. 1-i, 2-ii, 3-iii
B. 1-ii, 2-iii, 3-i
C. 1-ii, 2-i, 2-iii
D. 1-iii, 2-ii, 3-i

View Answer


10. Which of the following is correct option?

A. Compiler Error
B. 8 10
C. 8 8
D. 10 8

View Answer





Also check :


Discussion



* You must be logged in to add comment.