Online Test Instructions
  • This FREE online test has 10 questions. There is no negative marking.
  • Make sure to answer all questions before clicking submit.
  • If you clicked submit mistakenly click back button on your browser.
Help support us:
Need professional help? learn more
  • Our domain expert will teach you LIVE online one-on-one.
  • Both theory and practical applications will be illustrated.
  • Features will be demonstrated using boards, tools, compilers.
  • Softcopy will be provided having online test questions and answers.

C++ Function and Operator Overloading


1. Which of the following list of operators that cannot be overloaded in C++

==,::,!=,sizeof
.,::,==,>
.,::,.*,?:
.,!=,?:,sizeof

2. Which of the following is the meaning of the >> operator

Left shift operator
None of the given
Stream insertion operator
Stream extraction operator

3. Which one of the following is not true about operator overloading in C++?

Operator overloading allows you to redefine the way operator works for user-defined types only
Two operators = and & are already overloaded by default in C++
Operator overloading can be used for built-in types
Operator overloading cannot change the precedence and associatively of operators.

4. Which of the following is the meaning of the << operator

Right shift operator
Stream extraction operator
Stream insertion operator
None of the given

5. What is function overloading feature in C++

Function overloading feature allows us to have more than one function having same name but different parameter list
Function overloading feature allows us to have more than one function having same name and same return type
Function overloading feature allows us to have more than one function having different name but same parameter list
Function overloading feature allows us to have more than one function having same name but different return type

6. _________ Keyword introduces an overloaded-operator function definition

Class
Explicit
Operator
Protected

7. How to overload operators in C++ programming?

a special operator function is defined inside the class
a << is defined inside the class
a >> operator is defined inside the class
a * operator is defined inside the class

8. The two operators that are already overloaded by default in C++ are ____ and _____

== and !=
= and &
> and <
^ and !

9. To use operators on class objects, they must be overloaded, with the exception of operators ______, ______ and ______

assignment,address,greater than
address,not equal,comma
assignment,less than,address
assignment,address,comma

10. Overloaded postfix and prefix operators are distinguished by C++ compiler by

typecasting int parameter in the postfix version
typecasting int parameter in the prefix version
passing a dummy int parameter in the postfix version
passing a dummy int parameter in the prefix version