C++ MCQ

C++ MCQ | Freshers & Experienced

  • Sharad Jaiswal
  • 12th Feb, 2021

We have listed here the best C++ MCQ Questions for your basic knowledge of C++ Programming. This C++ MCQ Test contains 25 multiple Choice Questions. You have to select the right answer to every question.

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

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.

Related MCQ/Quiz

01st
Feb
React JS MCQ
01st
Feb
Angular Js MCQ
01st
Feb
Angular 2 MCQ
01st
Feb
JSON MCQ
01st
Feb
PHP MCQ