Top 80+ Solved Object Oriented Programming In cpp MCQ Questions Answer

From 61 to 75 of 87

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()

  • c. 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

  • c. all loops are executed the same number of times

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.

  • 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

  • c. depends on how it is invoked

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

  • b. a shallow copy just copies the values of the data as they are.

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

  • b. a deep copy just copies the values of the data as they are.

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

  • a. input iterator

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

  • 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

  • b. when the buffer is empty

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

  • 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

  • a. assign an integer 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)

  • a. structured programming

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

  • c. free integrity mechanism

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

  • b. private
Subscribe Now

Get All Updates & News