C++ MCQs with answers Page - 87

Here, you will find a collection of MCQ questions on C++. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

Q. Class function which is called automatically as soon as the object is created is called as __

  • (A) Inline function.
  • (B) Friend function
  • (C) Destructor
  • (D) Constructor

A

Admin • 833.24K Points
Coach

Q. Which type of data file is analogous to an audio cassette tape?

  • (A) Source code file
  • (B) Binary file
  • (C) Sequential access file
  • (D) Random access file

A

Admin • 833.24K Points
Coach

Q. What is the built in library function to compare two strings?

  • (A) str_compare()
  • (B) equals()
  • (C) strcmp()
  • (D) string_cmp()

A

Admin • 833.24K Points
Coach

Q. Which of the following are member dereferencing operators in CPP?
1.*
2. ::
3. ->*
4. ::*
5. ->

  • (A) Only 3, 4 and 5
  • (B) Only 3 and 4
  • (C) Only 1 and 5
  • (D) Only 1, 3, 4

A

Admin • 833.24K Points
Coach

Q. Default values for a function are specified when ____.

  • (A) Function is defined
  • (B) Function is declared
  • (C) Both a and b
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. Which of the following best defines the syntax for template function?

  • (A) Template
  • (B) Template return_type Function_Name(Parameters)
  • (C) Both a and b
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. Return type of uncaught_exception () is ________________.

  • (A) double
  • (B) char *
  • (C) bool
  • (D) int

A

Admin • 833.24K Points
Coach

Q. If inner catch handler is not able to handle the exception then__________.

  • (A) Compiler will look for outer try handler
  • (B) Program terminates abnormally
  • (C) Compiler will check for appropriate catch handler of outer try block
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. Which is the field width operator in C++

  • (A) endl
  • (B) set w
  • (C) new
  • (D) delete

A

Admin • 833.24K Points
Coach

Q. In C++ << operator used for shifting bits can also be used for

  • (A) decrement
  • (B) increment
  • (C) addition
  • (D) displaying values

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ