C++ MCQ Questions and Answers

Spread the love

Today in this article we are providing frequently asked C++ MCQ questions and answers for competitive exams. With the help of these C++ MCQ questions for the Computer Science exam, you can easily score good marks. Here we also provide you C++ MCQ Online test for all competitive exams.

These questions are very important for any type of competitive exam. So, practice with these C++ MCQ questions and answers pdf and clear your doubts.

You can also practice Basic Computer MCQ questions to enhance your general knowledge.

C++ MCQ Questions and Answers Pdf:

1. Who is the father of C++?
a) Dennis Ritchie
b) Bjarne Stroustrup
c) Alan Turing
d) Grace Hopper
Answer: B

2. What is any in C++?
a) STL container used to store a single value of any type
b) Exception class in C++
c) Fundamental type provided by C++
d) Template data type
Answer: A

3. Who created C++?
a) Dennis Ritchie
b) Bjarne Stroustrup
c) Alan Turing
d) Grace Hopper
Answer: B

4. Which type of language C++ is _____?
a) High-level Language
b) Low-level language
c) Middle-level language
d) None of the above
Answer: C

5. What type of language is C++ MCQ?
a) Pure Object-oriented
b) Not Object-oriented
c) Semi Object-oriented or Partial Object-oriented
d) None of the above
Answer: C

6. What is an array in C C++?
a) An array is a series of element
b) An array is a series of elements of the same type in contiguous memory locations
c) An array is a series of elements of the same type placed in non-contiguous memory locations
d) None of the mentioned
Answer: B

7. What was C++ originally called?
a) C with Objects
b) C with Variables
c) Both
d) None of these
Answer: A

8. Which of the following statement is correct about C++
a) C++ is a programming language developed by Bjarne Stroustrup in 1979 at Bell Labs.
b) C++ is regarded as a middle-level language, as it comprises a combination of both high-level and low-level language features.
c) It is a superset of C, and virtually any legal C program is a legal C++ program.
d) C++ runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.
e) All of these
Answer: E

9. What is an exception in C++ MCQ?
a) A problem that arises during compilation
b) Also known as the syntax error
c) Also known as semantic error
d) A problem that arises during the execution of a program
Answer: D

10. What is polymorphism in C++?
a) It is the ability for a message/data to be processed in more than one form
b) It is the ability for a message/data to be processed in only 1 form
c) It is the ability for many messages/data to be processed in one way
d) It is the ability for undefined message/data to be processed in at least one way
Answer:

11. Can we overload functions in C++ MCQ
a) Yes
b) No
c) Can not say
Answer: A

12. Which of the following is not a C++ keyword?
a) This
b) New
c) Cont
d) If
Answer: C

13. What is a class in C++
a) Class in C++ is the building block that leads to Object-Oriented programming.
b) A class is a user-defined data type that we can use in our program, and it works as an object constructor or a “blueprint” for creating objects.
c) In C++ programming, a Class is a fundamental block of a program that has its own set of methods and variables.
d) All of these
Answer: D

14. Which one of the following is a keyword in C++?
a) void,
b) public, private,
c) auto, return
d) All of these
Answer: D

15. What is inheritance in C++
a) Inheritance is a feature or a process in which, new classes are created from the existing classes.
b) Inheritance is a mechanism of reusing and extending existing classes without modifying them, thus producing hierarchical relationships between them.
c) Both of these
d) None of these
Answer: C

16. What is Virtual inheritance in C++?
a) Virtual inheritance is a C++ technique that ensures that only one copy of a base class’s member variables is inherited by second-level derivatives.
b) Virtual Inheritance is a feature or a process in which, new classes are created from the existing classes.
c) Virtual inheritance is a fundamental block of a program that has its own set of methods and variables.
d) Inheritance is a mechanism of reusing and extending existing classes without modifying them
Answer: A

17. Operator overloading in C++?
a) Only arithmetic operators can be overloaded
b) Only non-arithmetic operators can be overloaded
c) Precedence of operators is changed after overloading
d) The term operator overloading refers to giving the normal C++ operators additional meaning so that we can use them with user-defined data types.
Answer: D

18. What is the difference between an error and an exception?
a) Exceptions can be handled at the run-time but the errors cannot
b) Errors can be handled at the run-time but the exceptions cannot
c) Both are the same
d) Both can be handled during run-time
Answer: A

19. Which of the following is output statement in C++?
a) print
b) printf
c) cout.
d) Both b and c
Answer: D

20. Which one of the following is not a valid reserved keyword in C++?
a) Explicit
b) Public
c) Implicit
d) Private
Answer: C

21. Which of the following is an escape sequence in C++ mcq
a) \n
b) \r
c) \’
d) All of these
Answer: D

22. How “Late binding” is implemented in C++?
a) Using C++ tables
b) Using Indexed virtual tables
c) Using polymorphic tables
d) Using Virtual tables
Answer: D

23. Which of the following is correct in C++?
a) Classes cannot have protected data members
b) Structures can have member functions
c) Class members are public by default
d) Structure members are private by default
Answer: B

24. Which of the following is not an escape sequence?
a) \n
b) \r
c) \’
d) \p
Answer: D

25. What is the difference between delete and delete[] in C++?
a) delete is used to delete single object whereas delete[] is used to multiple(array/pointer of) objects
b) delete is used to delete normal objects whereas delete[] is used to pointer objects
c) delete is a keyword whereas delete[] is an identifier
d) delete is syntactically correct but delete[] is wrong and hence will give an error if used in any case
Answer: A

26. Which of the following is correct about this pointer in C++ mcq
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
Answer: B

27. Which operator can be overloaded in C++ mcq
a) . (dot or member access operator)
b) & (address-of operator)
c) size of operator
c) ?: (conditional operator)
Answer: D

28. Which of the following cannot be overloaded in C++
a) . (Member Access or Dot operator)
b) ?: (Ternary or Conditional Operator)
c) :: (Scope Resolution Operator)
d) All of the above
Answer: D

29. Which of the following is not a looping statement?
a) switch
b) while
c) do-while
d) for
Answer: A

If you have any problem or doubt regarding C++ MCQ questions and answers for Competitive Exams, you can ask in the comment box. For more practice on general knowledge questions, visit the next page.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *