Top 80+ Solved Object Oriented Programming In cpp MCQ Questions Answer
Q. Which of the following is the most general exception handler that catches exception of ‘any type’?
a. catch(std::exception)
b. catch(std::any_exception)
c. catch(…)
d. catch()
Q. In a group of nested loops, which loop is executed the most number of times?
a. the outermost loop
b. the innermost loop
c. all loops are executed the same number of times
d. cannot be determined without knowing the size of the loops
Q. What is the Difference between struct and class in terms of Access Modifier?
a. by default all the struct members are private while by default class members are public.
b. by default all the struct members are protected while by default class members are private.
Q. Inline functions are invoked at the time of
a. run time
b. compile time
c. depends on how it is invoked
d. both b and c above
Q. What is shallow copy?
a. a shallow copy creates a copy of the dynamically allocated objects too.
b. a shallow copy just copies the values of the data as they are.
c. a shallow copy creates a copy of the statically allocated objects too
d. both b and c above
Q. What is deep copy?
a. a deep copy creates a copy of the dynamically allocated objects too.
b. a deep copy just copies the values of the data as they are.
c. a deep copy creates a copy of the statically allocated objects too
d. both b and c above
Q. Which of the following below is /are a valid iterator type?
a. input iterator
b. backward iterator
c. forward iterator
d. both a and c above
Q. What defines a general set of operations that will be applied to various types of data?
a. template class
b. function template
c. class template
d. both a and c above
Q. Under which of the following circumstances, synchronization takes place?
a. when the file is closed
b. when the buffer is empty
c. explicitly, with manipulators
d. both a and c
Q. Which of the following functions below can be used Allocate space for array in memory?
a. calloc()
b. malloc()
c. realloc()
d. both a and b
Q. Statement scanf(“%d”,80);
a. assign an integer to variable i
b. give an error message
c. print the value of i
d. assign an float to variable i
Q. STL is based on which of the following programming paradigms?
a. structured programming
b. object oriented programming (oop)
c. functional programming
d. aspect oriented programming (aop)
Q. Which of the following is not a component of file system
a. access method
b. auxiliary storage management
c. free integrity mechanism
d. none of the above
Q. If there is more than one statement in the block of a for loop, which of the following must be placed at the beginning and the ending of the loop block?
a. parentheses ( )
b. braces { }
c. brackets [ ].
d. arrows < >
Q. Which of the following members do get inherited but become private members in child class
a. public
b. private
c. protected
d. all the above