//Write a program calculator using by Memberfunction
#include<iostream>
using namespace std;
class hasmot{
int a,b;
public:
void input()
{
cout<<"please enter your digit?";
cin>>a>>b;
}
void addition()
{
cout<<"\n \n"<<"enter your addition number?";
cout<<"\n \n"<<"Your addition outpur ="<<a+b<<endl;
}
void subition()
{
cout<<"\n \n"<<"enter your subition number?";
cout<<"\n \n"<<"Your subition outpur ="<<a-b<<endl;
}
void multipution()
{
cout<<"\n \n"<<"enter your multipution number?";
cout<<"\n \n"<<"Your multipution outpur ="<<a*b<<endl;
}
void divied()
{
cout<<"\n \n"<<"enter your divied number?";
cout<<"\n \n"<<"Your divied outpur ="<<a/b<<endl;
}
};
int main()
{
hasmot h;
h.input();
h.addition();
h.subition();
h.multipution();
h.divied();
return 0;
}
No comments:
Post a Comment