#include< conio.h >
class item
{
private:
int a,b,c,d;
public:
void get();
void multiply();
void sum();
};
void item::get()
{
cout<<"enter a & b :" ;
cin>>a>>b;
}
void item::sum()
{
c=a+b;
cout<<"\n sum is"<< c;
}
void item::multiply()
{
d=a*b;
cout<<"\n multiplication is "<< d;
}
void main()
{
clrscr();
item t;
t.get();
t.sum();
t.multiply();
getch();
}
-------------------------------------------------------
Out put
-------------------------------------------------------
Enter a & b : 5
4
Sum is 9
Multiplication is 20
0 comments :