Top 150+ Solved Object Oriented Programming with C++ (OOP in C++) MCQ Questions Answer

From 31 to 45 of 134

Q. The result of a Relational operation is always

a. either True or False

b. is less than or is more than

c. is equal or less or more

d. All of these

  • a. either True or False

Q. The visibility of variables inside a structure is

a. Private

b. Public

c. Protected

d. None of these

  • b. Public

Q. Within a switch statement

a. Continue can be used but Break cannot be used

b. Continue cannot be used but Break can be used

c. Both Continue and Break can be used

d. Neither Continue nor Break can be used

  • b. Continue cannot be used but Break can be used

Q. Observe following function declaration and choose the best Ans:: int divide ( int a, int b = 2 )

a. Variable b is of integer type and will always have value 2

b. Variable a and b are of int type and the initial value of both variables is 2

c. Variable b is international scope and will have value 2

d. Variable b will have value 2 if not specified when calling function

  • d. Variable b will have value 2 if not specified when calling function

Q. Arguments of a functions are separated with

a. comma (,)

b. semicolon (;)

c. colon (:)

d. None of these

  • a. comma (,)

Q. Variables inside parenthesis of functions declarations have _____ level access.

a. Local

b. Global

c. Module

d. Universal

  • a. Local

Q. A white space is :

a. blank space

b. new line

c. tab

d. all of the above

  • d. all of the above

Q. Which of the following statements are true in c++?

a. Classes cannot have data as public members.

b. Structures cannot have functions as members.

c. Structures cannot have functions as members.

d. None of these.

  • b. Structures cannot have functions as members.

Q. What will be the values of x, m and n after the execution of the following statements? int x, m, n;m = 10; n = 15; x = ++m + n++;

a. x=25, m=10, n=15

b. x=26, m=11, n=16

c. x=27, m=11, n=16

d. x=27, m=10, n=15

  • b. x=26, m=11, n=16

Q. Which of the following is an exit controlled loop?

a. While

b. For

c. Switch

d. do…. While

  • d. do…. While

Q. The same function name having different tasks

a. Function overloading

b. Constructor overloading

c. Polymorphism

d. Operator overloading

  • a. Function overloading

Q. The main function having argument

a. Default Argument

b. Command line argument

c. Const argument

d. Constructor overloading

  • b. Command line argument

Q. A function calling itself

a. Inline function

b. Static function

c. Friend function

d. Recursion

  • d. Recursion

Q. A private member function can be called by another function that is a member of a class iscalled

a. Friend function

b. Nesting of member function

c. Inline function

d. Static function

  • b. Nesting of member function

Q. The function that is a bridge between two classes

a. Friend function

b. Nesting of member function

c. Inline function

d. Static function

  • a. Friend function
Subscribe Now

Get All Updates & News