Top 150+ Solved Object Oriented Programming with C++ (OOP in C++) MCQ Questions Answer
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
Q. The visibility of variables inside a structure is
a. Private
b. Public
c. Protected
d. None of these
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
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
Q. Arguments of a functions are separated with
a. comma (,)
b. semicolon (;)
c. colon (:)
d. None of these
Q. Variables inside parenthesis of functions declarations have _____ level access.
a. Local
b. Global
c. Module
d. Universal
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.
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
Q. The same function name having different tasks
a. Function overloading
b. Constructor overloading
c. Polymorphism
d. Operator overloading
Q. The main function having argument
a. Default Argument
b. Command line argument
c. Const argument
d. Constructor overloading
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
Q. The function that is a bridge between two classes
a. Friend function
b. Nesting of member function
c. Inline function
d. Static function