#include <iostream>
using namespace std; 
class calculation
{
    public :
    int a, b; 
    void input ();
    void add();
    void sub ();
};
void calculation ::input ()
{
    cout <<"Enter the two numbers :"<<endl; 
    cin >>a>>b; 
    cout <<a<<"\t"<<b<<endl; 
}
void calculation ::add()
{
    cout <<"add result ="<<(a+b)<<endl; 
}
void calculation ::sub()
{
    cout <<"sub result="<<(a-b)<<endl; 
}
int main() {
    calculation x; 
    x. input();
    x. add();
    x. sub();
    return 0;
}

Embed on website

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