C++ MCQs with answers Page - 66

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. Which of the following functions below can be used Allocate space for array in memory?

  • (A) calloc()
  • (B) malloc()
  • (C) Realloc()
  • (D) Both A and B

A

Admin • 833.24K Points
Coach

Q. there is more than one statement in the block of a for loop, which of the following must be placed at the beginning and the ending of the loop block?

  • (A) arrows < >
  • (B) brackets [ ]
  • (C) braces { }
  • (D) parentheses ( )

A

Admin • 833.24K Points
Coach

Q. Which of the following members do get inherited but become private members in child class

  • (A) Private
  • (B) Protected
  • (C) Public
  • (D) All the above

A

Admin • 833.24K Points
Coach

Q. Which looping process is best used when the number of iterations is known?

  • (A) for
  • (B) while
  • (C) do-while
  • (D) looping processes require that the iterations be known

A

Admin • 833.24K Points
Coach

Q. In a C language ‘3’ represents

  • (A) A digit
  • (B) A character
  • (C) An integer
  • (D) A word

A

Admin • 833.24K Points
Coach

Q. What is the implicit pointer that is passed as the first argument for nonstatic member functions?

  • (A) ‘self’ pointer
  • (B) std::auto_ptr pointer
  • (C) Myself’ pointer
  • (D) ‘this’ pointer

A

Admin • 833.24K Points
Coach

Q. Which of the following operators can be overloaded?

  • (A) . (dot or member access operator)
  • (B) & (address-of operator)
  • (C) size of operator
  • (D) ?: (conditional operator)

A

Admin • 833.24K Points
Coach

Q. Which of the following is not a valid conditional inclusions in preprocessor directives

  • (A) #ifdef
  • (B) #ifundef
  • (C) #endif
  • (D) #elif

A

Admin • 833.24K Points
Coach

Q. Minimum number of temporary variable needed to swap the contents of 2 variables is:

  • (A) 0
  • (B) 1
  • (C) 2
  • (D) 3

A

Admin • 833.24K Points
Coach

Q. The output of this program is

Code:
int a = 10;
void main()
{
int a = 20;
cout << a << ::a;
}
  • (A) 20 20
  • (B) 20 10
  • (C) 10 20
  • (D) Syntax error

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