-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththis.cpp
More file actions
57 lines (45 loc) · 1022 Bytes
/
Copy paththis.cpp
File metadata and controls
57 lines (45 loc) · 1022 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include<iostream>
using namespace std;
class Arithematic
{
public:
int iNo1;
int iNo2;
Arithematic()
{
this->iNo1 = 0;
this->iNo2 = 0;
}
Arithematic(int A, int B)
{
this->iNo1 = A;
this->iNo2 = B;
}
int Addition()
{
int iAns = 0;
iAns = this->iNo1 + this->iNo2;
return iAns;
}
int Substraction()
{
int iAns = 0;
iAns = this->iNo1 - this->iNo2;
return iAns;
}
};
int main()
{
Arithematic aobj1(11,10);
Arithematic aobj2(21,20);
int iRet = 0;
iRet = aobj1.Addition();
cout<<"Addition is : "<<iRet<<"\n";
iRet = aobj1.Substraction();
cout<<"Substraction is : "<<iRet<<"\n";
iRet = aobj2.Addition();
cout<<"Addition is : "<<iRet<<"\n";
iRet = aobj2.Substraction();
cout<<"Substraction is : "<<iRet<<"\n";
return 0;
}