MULTIPLE INHERITANCE using c++

// MULTIPLE INHERITANCE
#include
#include
class m
{
protected:
int a;
public:
void get_m(int);
};
class n
{
protected:
int b;
public:
void get_n(int);
};
class p:public m,public n
{
public:
void display();
};
void m::get_m(int x)
{
a=x;
}
void n::get_n(int y)
{
b=y;
}
void p::display()
{
cout<<"\n\nOUTPUT :\n";
cout<<"The value of a="< cout<<"The value of b="< cout<<"The product a*b="<}
void main()
{
int a,b;
clrscr();
p obj;
cout<<"enter the value of a&b"< cin>>a>>b;
obj.get_m(a);
obj.get_n(b);
obj.display();
getch();
}


Comments