Skip to content

Commit 3b4199d

Browse files
added tutorial 17 cpp file from local machine
1 parent 488be9d commit 3b4199d

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

tut17.cpp

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
// Multiplication Table
5+
inline int product(int a, int b)
6+
{
7+
return a*b;
8+
}; // only make a function inline if the work in function is minimal
9+
10+
// int product(int a, int b)
11+
// {
12+
// static int c = 0;
13+
// c = c+ 1;
14+
// return a*b + c;
15+
// };
16+
17+
float moneyRecieved(int currentMoney, float factor = 1.04) {
18+
return currentMoney*factor;
19+
};
20+
21+
int main () {
22+
23+
// int a, b;
24+
// printf("Enter the first number: ");
25+
// cin>>a;
26+
// printf("Enter the second number: ");
27+
// cin>>b;
28+
// printf("\n");
29+
// cout<<"The product of first and second number is: "<<product(a,b);
30+
// cout<<"The product of first and second number is: "<<product(a,b);
31+
// cout<<"The product of first and second number is: "<<product(a,b);
32+
// cout<<"The product of first and second number is: "<<product(a,b);
33+
// cout<<"The product of first and second number is: "<<product(a,b);
34+
// cout<<"The product of first and second number is: "<<product(a,b);
35+
36+
int money = 1000;
37+
cout<<"If you have "<<money<<" INR into your bank account, you will recieve "
38+
<<moneyRecieved(money)<<" INR after 1 year."<<endl;
39+
cout<<"For VIP: If you have "<<money<<" INR into your bank account, you will recieve "
40+
<<moneyRecieved(money, 1.1)<<" INR after 1 year.";
41+
42+
43+
return 0;
44+
}

0 commit comments

Comments
 (0)