Choose Category
//arithmetic operations #include<iostream.h> #include<conio.h> class arithmetic { public: void add(int a,int b) { int c=a+b; cout<<"\naddition:"<<c; } void sub(int c,int d) { int e=c-d; cout<<"\nsubtraction:"<<e; } void mul(int x,int y) { int z=x*y; cout<<"\nMultiply:"<<z; } void div(int p,int q) { float r=p/q; cout<<"\nDivision:"<<r; } }; void main() { arithmetic a; int first, second; cout<<"Enter two integrs:"; cin>>first>>second; a.add(first,second); a.sub(first,second); a.mul(first,second); a.div(first,second); getch(); }