Menu:

ADA (8) OOT (5)

Tuesday, March 8, 2016

Program to show Multilevel Inheritance

#include<iostream>
using namespace std;
class A
{
public:
void showdata()
{
cout<<"Class a";
}
};
class B:public A
{
public:
void showdata1()
{
cout<<"Class B";
}
};
class C:public B
{
public:
void showdata2()
{
cout<<"Class C";
}
};
int main()
{
C obj;
obj.showdata();
obj.showdata1();
obj.showdata2();
return 0;
}

No comments:

Post a Comment