C++ MCQ Questions

C++ MCQ Questions | Freshers & Experienced

  • Sharad Jaiswal
  • 24th Jun, 2021

We have listed here the best C++ MCQ Questions for your basic knowledge of C++ Programming. This C++ MCQ Test contains 30+ C++ Multiple Choice Questions. You have to select the right answer to every question to check your final preparation for the C++ MCQ Interview or Exams.

Practice Best C++ MCQ Questions;

1) Constant variables can be created in CPP by using ________ .

  • A. const
  • B.enum
  • C.#define
  • D.All of these

2) Can a class be declared/defined inside another class ?

  • A. Yes
  • B.No

3) Classes in CPP are________ .

  • A. derived data types
  • B.built-in data types
  • C.user defined data types
  • D.All of the above

4) Who is the father of C++?

  • A. Bjarne Stroustrup
  • B.William Mayers
  • C.David Stroustrup
  • D.None of the above

5) How to stop Name Mangling in C++?

  • A. It is possible only with C code
  • B.By using extern "C" keyword
  • C.By Converting C++ code to
  • D.It is not possible

6) What is the size of empty class?

  • A. 0
  • B.1
  • C.2
  • D.4

7) What is size of void in C++?

  • A. Undefined
  • B.2 Bytes
  • C.4 Bytes

8) Can any function call itself?

  • A. Yes
  • B.No
  • C.Runtime Error
  • D.Compilation Error

9) A protected member of the class in accessible in

  • A. Only same class
  • B.Outside the class
  • C.Same class and derived class
  • D.None of the above.

10) What is the full form of RTTI?

  • A. Robust Template Type Inheritance
  • B.Runtime type identification
  • C.Runtime template identification
  • D.None of the above

11) Identify the C++ compiler of Linux?

  • A. vc++
  • B.cpp
  • C.g++
  • D.Borland

12) Which isn't a loop structure?

  • A. For
  • B.While
  • C.Repeat Unit
  • D.Do While

13) Which one of the following is a built in function?

  • A. Stringlen ()
  • B.Strlength ()
  • C.Strlen ()
  • D.Strleng ()

14) --------------- is used to write a single character to output file.

  • A. Cin()
  • B.Put()
  • C.Get()
  • D.None of the above

15) What is the index no. of the last element of an array with 9 element?

  • A. 9
  • B.0
  • C.8
  • D.Programming- Defined

16) The name of a function variable or class is called -------------.

  • A. Libraries
  • B.Stream
  • C.Keyword
  • D.Identifier

17) << is called as ------------- operator.

  • A. Insertion
  • B.Extraction
  • C.Greater than
  • D.Less than.

18) How “Late binding” is implemented in C++?

  • A. Using polymorphic tables
  • B.Using Virtual tables
  • C.Using Indexed virtual tables
  • D.Using C++ tables

19) Which are used for generic programming.

  • A. Virtual Functions
  • B.Inheritance
  • C.Templates
  • D.None of the above

20) int a = 10; and int a(10); are equivalent?

  • A. Yes
  • B.No

21) What do you mean by abstract class?

  • A. A class with no functions in it
  • B.A class with atleast one pure virtual function
  • C.A class with abstract keyword
  • D.Empty Class

22) Which of the following isn't a keyword?

  • A. Inherent
  • B.Void
  • C.Extern
  • D.Auto

23) The result of the expression of 15%3 in c++ is --------------.

  • A. 0
  • B.3
  • C.5
  • D.Error

24) In how many ways to polymorphism achieved in c++?

  • A. 3
  • B.1
  • C.5
  • D.2

25) Object oriented programming employs_________ programming approach.

  • A. top-down
  • B.bottom-up
  • C.procedural
  • D.none of the above

26) Enum types are processed by

  • A. Preprocessor
  • B.Assembler
  • C.Compiler
  • D.Linker

27) What is the similarity between a structure union and enumeration

  • A. All of them let you define new values
  • B.All of them let you define new pointers
  • C.All of them let you define new structures
  • D.All of them let you define new data types

28) What is the similarity between a structure union and enumeration

  • A. All of them let you define new values
  • B.All of them let you define new pointers
  • C.All of them let you define new structures
  • D.All of them let you define new data types

29) Which of the following is the correct syntax to read the single character to console in the C++ language?

  • A. get(ch)
  • B.Read ch()
  • C.Scanf(ch)
  • D.Getline vh()

30) What is the size of a boolean variable in c++?

  • A. 1bit
  • B.1 byte
  • C.2 bytes
  • D.2 bits

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.

Related MCQ/Quiz

01st
Jun
Python MCQ
01st
May
Fiber Optics MCQ
01st
Feb
Powerpoint MCQ
01st
May
Perl MCQ