Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
Write a C++ program using concept of hierarchical inheritance.
SUBMITTED BY:
Nrupeshsinh
DATE:
June 26, 2016, 4:18 a.m.
FORMAT:
C++
SIZE:
395 Bytes
Raw
Download
Tweet
HITS:
466
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