#include<iostream.h>
#include<conio.h>
class ad
{
private:
int n;
public:
void getdata()
{
cout<<"Enter the value of NUm";
cin>>n;
}
ad operator + (ad ob,ad ob1)
{
int v;
v=n+ob.n;
}
void show()
{
cout<<n;
}
};
void main()
{
ad num,num2,num1;
num.getdata();
num1.getdata();
num2=num+num1;
num2.show();
getch();
}
I'm tring to make a class where user can multipul addition (e.g 2+5+3)
without pressing enter in every value.
use only enter 5+8+6+10+15
after process ans show.