-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtut17.cpp
44 lines (36 loc) · 1.34 KB
/
tut17.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
#include <iostream>
using namespace std;
// Multiplication Table
inline int product(int a, int b)
{
return a*b;
}; // only make a function inline if the work in function is minimal
// int product(int a, int b)
// {
// static int c = 0;
// c = c+ 1;
// return a*b + c;
// };
float moneyRecieved(int currentMoney, float factor = 1.04) {
return currentMoney*factor;
};
int main () {
// int a, b;
// printf("Enter the first number: ");
// cin>>a;
// printf("Enter the second number: ");
// cin>>b;
// printf("\n");
// cout<<"The product of first and second number is: "<<product(a,b);
// cout<<"The product of first and second number is: "<<product(a,b);
// cout<<"The product of first and second number is: "<<product(a,b);
// cout<<"The product of first and second number is: "<<product(a,b);
// cout<<"The product of first and second number is: "<<product(a,b);
// cout<<"The product of first and second number is: "<<product(a,b);
int money = 1000;
cout<<"If you have "<<money<<" INR into your bank account, you will recieve "
<<moneyRecieved(money)<<" INR after 1 year."<<endl;
cout<<"For VIP: If you have "<<money<<" INR into your bank account, you will recieve "
<<moneyRecieved(money, 1.1)<<" INR after 1 year.";
return 0;
}