-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path18.cpp
63 lines (53 loc) · 1.37 KB
/
18.cpp
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
59
60
61
62
63
#include <iostream>
using namespace std;
/*
// Inline Fxn
inline int Product(int a, int b)
{
return a * b;
}
int main()
{
int a, b;
cout << "Enter the values of a and b" << endl;
cin >> a >> b;
cout << "Value is " << Product(a, b) << endl;
cout << "Value is " << Product(a, b) + 2 << endl;
cout << "Value is " << Product(a, b) - 8 << endl;
cout << "Value is " << Product(a, b) / 3 << endl;
cout << "Value is " << Product(a, b) / 5 << endl;
return 0;
}
*/
/*
// Static Variables
int Product(int a, int b)
{
int static c = 0;
c += 1;
return a * b + c;
}
int main()
{
int a, b;
cout << "Enter the values of a and b" << endl;
cin >> a >> b;
cout << "Value is " << Product(a, b) << endl;
cout << "Value is " << Product(a, b) << endl;
cout << "Value is " << Product(a, b) << endl;
cout << "Value is " << Product(a, b) << endl;
cout << "Value is " << Product(a, b) << endl;
return 0;
}
*/
float MoneyReceived(float currentMoney, float rate = 4)
{
return currentMoney * (1 + rate / 100);
}
int main()
{
int money = 100000;
cout << "If you have " << money << " in your account, you will get " << MoneyReceived(money) << " after 1 year" << endl;
cout << "For VIP, If you have " << money << " in your account, you will get " << MoneyReceived(money,10) << " after 1 year" << endl;
return 0;
}