#include <iostream>
using namespace std; 
class sum
{
    int a; 
    public :
    void input ()
    {
        cin>>a; 
    }
    sum operator +(sum c)
    {
        sum t; 
        t. a=a+c.a;
        return t; 
    }
    void display ()
    {
        cout <<"value of a is "<<a; 
    }
};
int main() {
    sum s1,s2,s3;
    s1.input();
    s2.input();
    s3=s1+s2;
    s3.display();
    return 0;
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: