-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinlineFunction.cpp
More file actions
58 lines (50 loc) · 836 Bytes
/
inlineFunction.cpp
File metadata and controls
58 lines (50 loc) · 836 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
58
#include <iostream>
using namespace std;
class operation
{
int a, b, add, sub, mul;
float div;
public:
void getdata();
void sum();
void diff();
void product();
void division();
};
inline void operation::getdata()
{
cout << "Enter value of a : ";
cin >> a;
cout << "Enter value of b : ";
cin >> b;
}
inline void operation::sum()
{
add = a + b;
cout << "Sum is : " << add;
}
inline void operation::diff()
{
sub = a - b;
cout << "\nSubtraction is : " << sub;
}
inline void operation::product()
{
mul = a * b;
cout << "\nProduct is : " << mul;
}
inline void operation::division()
{
div = a / b;
cout << "\nDivision is : " << div;
}
int main()
{
operation a;
a.getdata();
a.sum();
a.diff();
a.product();
a.division();
return 0;
}