Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
Write a C++ program using concept of hierarchical inheritance.
SUBMITTED BY:
Nrupeshsinh
DATE:
June 30, 2016, 2:30 p.m.
FORMAT:
Text only
SIZE:
397 Bytes
Raw
Download
Tweet
HITS:
318
Go to comments
Report
# include<iostream.h>
# include<conio.h>
class A
{
public:
void show()
{
cout<<"base"<<endl;
}
};
class B :public A
{
public:
void show1()
{
cout<<"derived"<<endl;
}
};
class C : public A
{
public:
void show2()
{
cout<<"derived";
}
};
void main()
{
clrscr();
B obj;
C obj1;
obj.show();
obj.show1();
obj1.show2();
getch();
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus