#include<iostream>
using namespace std;
class add
{
private:
int iNum1, iNum2, iNum3;
void input(int iVar1, int iVar2)
{
cout<<"Functions to assign values to the member data"<<endl;
iNum1=iVar1;
iNum2=iVar2;
}
void sum(void)
{
cout<<"Functions to find the sum of two numbers"<<endl;
iNum3=iNum1+iNum2;
}
void disp(void)
{
cout<<"The sum of the two numbers is "<<iNum3<<endl;
}
public:
void input(){
int iX, iY;
cout<<"Input two numbers"<<endl;
cin>>iX;
cin>>iY;
input(iX,iY);
}
void report(){
sum();
disp();
}
};
void main(){
add A1;
A1.input();
A1.report();
system("pause");
}
Comments