#include<iostream.h>
#include<conio.h>
class a
{
protected:
int m;
public:
void get1(int);
};
class b
{
protected:
int p;
public:
void get2(int);
};
class c:public a,public b
{
public:
int c;
void display(void);
};
void a::get1(int x)
{
m=x;
}
void b::get2(int y)
{
p=y;
}
void c::display()
{
c=m+p;
cout<<"\n Addition= "<<c;
}
void main()
{
clrscr();
c c1;
c1.get1(10);
c1.get2(10);
c1.display();
getch();
}
#include<conio.h>
class a
{
protected:
int m;
public:
void get1(int);
};
class b
{
protected:
int p;
public:
void get2(int);
};
class c:public a,public b
{
public:
int c;
void display(void);
};
void a::get1(int x)
{
m=x;
}
void b::get2(int y)
{
p=y;
}
void c::display()
{
c=m+p;
cout<<"\n Addition= "<<c;
}
void main()
{
clrscr();
c c1;
c1.get1(10);
c1.get2(10);
c1.display();
getch();
}
No comments:
Post a Comment