#include<iostream>
using namespace std;
class subtract
{
private:
int number1;
int number2;
public:
void set(int a, int b)
{
number1=a;
number2=b;
}
void get()
{
cout<<"enter first number: "<<endl;
cin>>number1;
cout<<"enter second number: "<<endl;
cin>>number2;
}
void print()
{
cout<<"subtraction of two numbers is: "<<number1-number2;
cout<<endl;
}
};
void main()
{
subtract s1,s2;
s1.get();
s2.set(20,10);
s1.print();
}
No comments:
Post a Comment