Top 80+ Solved CPP Programming MCQ Questions Answer

From 61 to 75 of 86

Q. When a virtual function is redefined by the derived class, it is called___________.

a. Overloading

b. Overriding

c. Rewriting

d. All of these

  • b. Overriding

Q. Where the default value of parameter have to be specified?

a. Function call

b. Function definition

c. Function prototype

d. Both B or C

  • c. Function prototype

Q. For automatic objects, constructors and destructors are called each time the objects

a. enter and leave scope

b. inherit parent class

c. are constructed

d. are destroyed

  • a. enter and leave scope

Q. Which operation is used as Logical 'AND'

a. Operator-&

b. Operator-

c. Operator-&&

d. Operator +

  • c. Operator-&&

Q. When an ADT is implemented as a C++ class, which of the following should normally betrue?

a. Member functions are private, member variables are public

b. Member functions are public, member variables are private

c. Member functions as well as member variables are private

d. Member functions as well as member variables are public

  • b. Member functions are public, member variables are private

Q. Variable that are listed in function's calls are called

a. Actual parameter

b. Declared parameter

c. Passed parameter

d. None

  • b. Declared parameter

Q. What kind of error can arise when there is a problem with memory?

a. Segmentation fault

b. Produce an error

c. Both Segmentation fault & Produce an error

d. None of the mentioned

  • a. Segmentation fault

Q. Which operations don’t throw anything?

a. Operations which are reversible

b. Operations which are irreversible

c. Operations which are static

d. Operations which are dynamic

  • b. Operations which are irreversible

Q. What operation can be performed by destructor?

a. Abort the program

b. Resource cleanup

c. Exit from the current block

d. None of the mentioned

  • b. Resource cleanup

Q. Which interface in the container is required for storage management?

a. Memory management

b. Allocator interface

c. Memory interface

d. None of the mentioned

  • b. Allocator interface

Q. How can the member functions in the container be accessed?

a. Iterator

b. Indirect

c. Both Iterator & Indirect

d. None of the mentioned

  • a. Iterator

Q. In which type of storage location are the vector members stored?

a. Contiguous storage locations

b. Non-contiguous storage locations

c. Contiguous & Non-contiguous storage locations

d. None of the mentioned

  • a. Contiguous storage locations

Q. What do container adapter provide to interface?

a. Restricted interface

b. More interface

c. No interface

d. None

  • a. Restricted interface

Q. What does the sequence adaptor provide?

a. Insertion

b. Deletion

c. Interface to sequence container

d. None

  • c. Interface to sequence container
Subscribe Now

Get All Updates & News