#include
#include
using namespace std;
class number1
{
protected:
tuple<int,int>no1;
public:
tuple<int,int> set1(int m, int n)
{
no1=make_tuple(m,n);
return(no1);
}
tuple<int,int> shownumber1()
{
cout << "ur number is " << get<0>(no1) << "+i" << get<1>(no1) << endl;
return(no1);
}
};
class number2
{
protected:
tuple<int, int> no2;
public:
tuple<int, int> set2(int m, int n)
{
no2 = make_tuple(m, n);
return (no2);
}
tuple<int, int> shownumber2()
{
cout << "ur number is " << get<0>(no2) << "+i" << get<1>(no2) << endl;
return (no2);
}
};
class sum :public number1,public number2
{
protected:
tuple<int,int>no;
public:
void shownumber(){
no=make_tuple((get<0>(no1)+get<0>(no1)),(get<1>(no2)+get<1>(no2)));
}
void display()
{
cout << "ur number is " << get<0>(no) << "+i" << get<1>(no) << endl;
}
};
int main()
{
number1 q;
q.set1(1, 2);
q.shownumber1();
number2 w;
w.set2(3, 4);
w.shownumber2();
sum r;
r.shownumber();
r.display();
}
i can,t access tuple value of no from here