Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
Write a C++ Program using concept of single Inheritance.
SUBMITTED BY:
Nrupeshsinh
DATE:
June 26, 2016, 4:21 a.m.
FORMAT:
C++
SIZE:
360 Bytes
Raw
Download
Tweet
HITS:
495
Go to comments
Report
#
include
<iostream.h>
#
include
<conio.h>
class
A
{
public
:
int
a
,
b
;
void
show
()
{
cout
<<
"Enter value of A="
;
cin
>>
a
;
cout
<<
"Enter value of B="
;
cin
>>
b
;
}
};
class
B
:
public
A
{
public
:
void
display
()
{
cout
<<
"Sum="
<<
a
+
b
;
}
};
void
main
()
{
clrscr
();
B
obj
;
obj
.
show
();
obj
.
display
();
getch
();
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus