Q:

What is output of the following program?

0

What is output of the following program?

class student
{ 
    public : int marks; 
 void disp() 
 { 
  cout<<”its base class”
 };
 class topper:public student
 {
  public : 
  void disp()
  { 
   cout<<”Its derived class”; 
  }
 }
 void main() { student s; topper t;
 s.disp();
 t.disp();
}

  1. Its base classIts derived class
  2. Its base class Its derived class
  3. Its derived classIts base class
  4. Its derived class Its base class

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

 (a).Its base classIts derived class

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

OBJECT ORIENTED PROGRAMMING OOPS CONCEPT AND FEATURES MCQ

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Which among the following can show polymorphism?... >>
<< Which among the following can’t be used for poly...