Top 80+ Solved CPP Programming MCQ Questions Answer
Q. When a virtual function is redefined by the derived class, it is called___________.
a. Overloading
b. Overriding
c. Rewriting
d. All of these
Q. While overloading binary operators using member function, it requires ___ argument/s.
a. Zero
b. One
c. Two
d. Three
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
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
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
Q. Variable that are listed in function's calls are called
a. Actual parameter
b. Declared parameter
c. Passed parameter
d. None
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
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
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
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
Q. How can the member functions in the container be accessed?
a. Iterator
b. Indirect
c. Both Iterator & Indirect
d. None of the mentioned
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
Q. What do container adapter provide to interface?
a. Restricted interface
b. More interface
c. No interface
d. None
Q. What does the sequence adaptor provide?
a. Insertion
b. Deletion
c. Interface to sequence container
d. None