#include<iostream.h>
#include<conio.h>
class A
{
public:
int a,b;
void getdata()
{
cout<<"Enter two numbers:";
cin>>a;
cin>>b;
}
};
class B:public A
{
public:
int c;
void add()
{
c=a+b;
}
void disp()
{
cout<<"sum of two numbers:";
cout<<c;
}
};
void main()
{
B b;
clrscr();
b.getdata();
b.add();
b.disp();
getch();
}
output will not display suggested to me
ReplyDelete