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

From 16 to 30 of 134

Q. By default, the members of a C++ class are:

a. Private

b. Public

c. Protected

d. None of these

  • a. Private

Q. Which of the following function that must contain in all C++ Programs

a. start()

b. system()

c. main()

d. program()

  • c. main()

Q. C++ is originally developed by

a. Nicolas Wirth

b. Dennis Ritchi

c. Bjarne Stroustrup

d. Ken Thompson

  • c. Bjarne Stroustrup

Q. The operator ‘<< ‘is called

a. Get from operator

b. Put to operator

c. Extraction operator

d. None of these

  • b. Put to operator

Q. Identify the unary operator.

a. ? , :

b. ++

c. +

d. %

  • b. ++

Q. To increase the value of c by one which of the following statement is wrong?

a. c++;

b. c = c + 1;

c. c + 1 => c;

d. c += 1

  • c. c + 1 => c;

Q. In an assignment statement a=b Which of the following statement is true?

a. The variable a and the variable b are equal.

b. The value of b is assigned to variable a but the later changes on variable b will not affect the value of variable a

c. The value of b is assigned to variable a and the later changes on variable b will affect the value of variable a

d. The value of variable a is assigned to variable b and the value of variable b is assigned to variable a.

  • b. The value of b is assigned to variable a but the later changes on variable b will not affect the value of variable a

Q. The continue statement

a. resumes the program if it is hanged

b. resumes the program if it was break was applied

c. skips the rest of the loop in current iteration

d. all of above

  • c. skips the rest of the loop in current iteration

Q. Find out the error in following block of code. If (x = 100) Cout << “x is 100”;

a. 100 should be enclosed in quotations

b. There is no semicolon at the end of first line

c. Equals to operator mistake

d. Variable x should not be inside quotation

  • c. Equals to operator mistake

Q. When following piece of code is executed, what happens?b = 3; a = b++;

a. a contains 3 and b contains 4

b. a contains 4 and b contains 4

c. a contains 4 and b contains 3

d. a contains 3 and b contains 3

  • a. a contains 3 and b contains 4

Q. In case of arguments passed by values when calling a function such as z=addidion(x,y),

a. Any modifications to the variables x & y from inside the function will not have any effect outside the function.

b. The variables x and y will be updated when any modification is done in the function

c. The variables x and y are passed to the function addition

d. None of above are vali

  • a. Any modifications to the variables x & y from inside the function will not have any effect outside the function.

Q. How many times is a do while loop guaranteed to loop?

a. 0

b. Infinitely

c. 1

d. variable

Subscribe Now

Get All Updates & News