Top 80+ Solved CPP Programming MCQ Questions Answer

From 31 to 45 of 86

Q. How C++ compiler does differ between overloaded postfix and prefix operators?

a. C++ doesn’t allow both operators to be overloaded in a class

b. A postfix ++ has a dummy parameter

c. A prefix ++ has a dummy parameter

d. By making prefix ++ as a global function and postfix as a member function.

  • b. A postfix ++ has a dummy parameter

Q. Which of the following operator functions cannot be global?

a. new

b. delete

c. Conversion Operator

d. All of the above

  • c. Conversion Operator

Q. Which of the following is true about this pointer?

a. It is passed as a hidden argument to all function calls

b. It is passed as a hidden argument to all non-static function calls

c. It is passed as a hidden argument to all static functions

d. None of the above

  • b. It is passed as a hidden argument to all non-static function calls

Q. What is the use of this pointer?

a. When local variable’s name is same as member’s name, we can access member using this pointer.

b. To return reference to the calling object

c. Can be used for chained function calls on an object

d. All of the above

  • d. All of the above

Q. Which of the following in Object Oriented Programming is supported by Function overloading and default arguments features of C++?

a. Inheritance

b. Polymorphism

c. Encapsulation

d. None of the above

  • b. Polymorphism

Q. Pick the odd one out

a. array type

b. character type

c. Boolean type

d. integer type

  • a. array type

Q. Which data type is used to represent the absence of parameters?

a. int

b. short

c. void

d. float

  • c. void

Q. What does an escape code represent?

a. alert

b. backslash

c. tab

d. form feed

  • a. alert

Q. Which type is best suited to represent the logical values?

a. integer

b. Boolean

c. character

d. all of the mentioned

  • b. Boolean

Q. Identify the user-defined types from the following?

a. enumeration

b. classes

c. both enumeration and classes

d. int

  • c. both enumeration and classes

Q. Which of the following statements are true? int f (float)

a. f is a function taking an argument of type int and returning a floating point number

b. f is a function taking an argument of type float and returning an integer

c. f is a function of type float

d. none of the mentioned

  • b. f is a function taking an argument of type float and returning an integer

Q. The value 132.54 can be represented using which data type?

a. double

b. void

c. int

d. bool

  • a. double
Subscribe Now

Get All Updates & News