Simplified guide of MCQs for Exams, Interviews

Sub Topic: C++

1 .  When a child class inherits traits from more than one parent class, this type of inheritance is called _______________ inheritance.

  • A. Hierarchical
  • B. Hybrid
  • C. Multilevel
  • D. Multiple

Correct Answer:

Multiple


2 .  Which of the followings is/are not keyword in CPP?

  • A. asm
  • B. boolean
  • C. mutable

Correct Answer:

boolean


3 .  We can create objects of the abstract class.

  • A. True
  • B. False

Correct Answer:

False


4 .  What is the output pf the following code?<br> int x=20,y=35; x=y++ + x++; cout << x << y;

  • A. 5794
  • B. 2035
  • C. 2136
  • D. 6070

Correct Answer:

5794


5 .  What is the output of the following code.<br> int i=5,j=6,k=7,n=3;<br> cout<<i+j*k-k%n<<endl;<br> cout<<i/n<<endl;<br>

  • A. 46 and 1
  • B. 50 and 80
  • C. 45 abd 2

Correct Answer:

46 and 1