Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests - Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests -

C++ MCQs

Bjarne Stroustrup created C++ as an extension of C programming. It is a general-purpose language similar to C programming, which over time, expanded significantly.

The main advantages of C++ are mainly

  • Portability
  • Object-oriented
  • Memory management
  • Multi-paradigm
  • Fast and powerful

MCQs on C++

Solve C++ Multiple-Choice Questions to prepare better for GATE. If you wish to learn more about C++ and C++ MCQs, you can check notes, mock tests, and previous years’ question papers. Gauge the pattern of MCQs on C++ by solving the ones that we have compiled below for your practice:

C++ Multiple-Choice Questions

1. Which of these types is not provided by C but is provided by C++?

a. double

b. float

c. bool

d. int

Answer: (c) bool

2. Which concept do we use for the implementation of late binding?

a. Static Functions

b. Constant Functions

c. Operator Functions

d. Virtual Functions

Answer: (d) Virtual functions

3. Which of these won’t return any value?

a. void

b. null

c. free

d. empty

Answer: (a) void

4. Which function do we use for checking if a character is a space or a tab?

a. isdigit()

b. isblank()

c. isalnum()

d. isalpha()

Answer: (b) isblank()

5. What would happen in case one uses a void in the passing of an argument?

a. It would return any value

b. It may not or may depend on a declared return type of any function. The return type of the function is different from the passed arguments

c. It would return some value to the caller

d. It would not return any value to the caller

Answer: (d) It would not return any value to the caller

6. __________ is an ability of grouping certain lines of code that we need to include in our program?

a. macros

b. modularization

c. program control

d. specific task

Answer: (b) modularization

7. Which of these keywords do we use for the declaration of the friend function?

a. myfriend

b. classfriend

c. friend

d. firend

Answer: (c) friend

8. What is used for dereferencing?

a. pointer with asterix

b. pointer without asterix

c. value with asterix

d. value without asterix

Answer: (a) pointer with asterix

9. What does polymorphism stand for?

a. a class that has four forms

b. a class that has two forms

c. a class that has only a single form

d. a class that has many forms

Answer: (d) a class that has many forms

10. What handler do we use if we want to handle all the types of exceptions?

a. try-catch handler

b. catch-none handler

c. catch-all handler

d. catch handler

Answer: (c) catch-all handler

11. What do we use in order to throw an exception?

a. try

b. throw

c. handler

d. catch

Answer: (b) throw

12. We can apply RTTI to which of the class types?

a. Polymorphic

b. Encapsulation

c. Static

d. Derived

Answer: (a) Polymorphic

13. Which header file do we use for the generation of random numbers?

a. <random>

b. <generator>

c. <distribution>

d. <gen_dist>

Answer: (a) <random>

14. Which container is the best for keeping a collection of various distinct elements?

a. queue

b. set

c. heap

d. multimap

Answer: (b) set

15. Inheritance models which type of relationship?

a. Belongs-to relationship

b. Part-Of relationship

c. Is-A relationship

d. Has-A relationship

Answer: (c) Is-A relationship

16. In heap, which of these values will be pointed out first?

a. First value

b. Lowest value

c. Third value

d. Highest value

Answer: (d) Highest value

17. Which of these functions is used for incrementing the iterator by a certain value?

a. move()

b. prev()

c. advance()

d. next()

Answer: (c) advance()

18. In the locale object, which of these objects’ information is loaded?

a. secant object

b. facet object

c. instead object

d. both instead & facet objects

Answer: (b) facet object

19. Which of these mathematics libraries is used in C++ for vector manipulation?

a. blitz++

b. stac++

c. vec++

d. cli+++

Answer: (a) blitz++

20. Which of these operators is used in order to capture every external variable by reference?

a. *

b. &&

c. &

d. =

Answer: (d) =

Keep learning and stay tuned to get the latest updates on the GATE Exam along with GATE MCQs, GATE Eligibility Criteria, GATE Syllabus for CSE (Computer Science Engineering), GATE Notes for CSE, GATE CSE Question Paper, and more.

Comments

Leave a Comment

Your Mobile number and Email id will not be published.

*

*