OUTPUT OF MULTILEVEL INHERITANCE
Program:--
#include<iostream.h>
#include<conio.h>
class student
{
public:
void display()
{
cout<<"This is the 1st Class"<<endl;
}
};
class result:public student
{
public:
void display1()
{
cout<<"This is the 2nd Class"<<endl;
}
} ;
class marks :public result
{
public:
void getdata()
{
cout<<"This is the 3rd Class";
}
};
void main()
{
clrscr();
marks s;
s.display();
s.display1();
s.getdata();
getch();
}
No comments:
Post a Comment