#include<iostream.h>
#include<conio.h>
class data1
{
public:
int a,b;
void get1();
};
class data2
{
public:
int c,d;
void get2();
};
class data3
{
int x,y;
void show();
public:
void sum(data1,data2);
};
main()
{
clrscr();
data1 d1;
data2 d2;
data3 d3;
d1.get1();
d2.get2();
d3.sum(d1,d2);
}
void data1::get1()
{
cout<<"Enter for a: ";
cin>>a;
cout<<"Enter for b: ";
cin>>b;
}
void data2::get2()
{
cout<<"Enter for c: ";
cin>>c;
cout<<"Enter for d: ";
cin>>d;
}
void data3::sum(data1 a1,data2 a2)
{
x=a1.a+a2.c;
y=a1.b+a2.d;
show();
}
void data3::show()
{
cout<<"X= "<<x<<endl;
cout<<"Y= "<<y<<endl;
}