-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtut17.cpp
More file actions
39 lines (34 loc) · 1.53 KB
/
tut17.cpp
File metadata and controls
39 lines (34 loc) · 1.53 KB
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
// #include <iostream>
// using namespace std;
// it increase the time of runnig code
// and replace the product wiht return value direct so it take less time to execute
// Static variable is used to initialize the line only one time
// inline int product(int x, int y)
// { // not recommended to use this function with below line of code
// // static int c = 0 ; // this excutes only one time
// // c =c+1; // This is run and it reatin the value of c
// // return x * y + c;]
// return x*y ;
// }
// int main()
// {
// int a, b;
// cout << "Enter the value of a and b " << endl;
// cin >> a >> b;
// cout << "The product of a and b is " << product(a, b) << endl;
// cout << "The product of a and b is " << product(a, b) << endl;
// cout << "The product of a and b is " << product(a, b) << endl;
// cout << "The product of a and b is " << product(a, b) << endl;
// cout << "The product of a and b is " << product(a, b) << endl;
// cout << "The product of a and b is " << product(a, b) << endl;
// cout << "The product of a and b is " << product(a, b) << endl;
// }
// float moneyReceived(int currentMoney, float factor=1.04){
// return currentMoney * factor;
// }
// int main(){
// int money = 100000;
// cout<<"If you have "<<money<<" Rs in your bank account, you will recive "<<moneyReceived(money)<< "Rs after 1 year"<<endl;
// cout<<"For VIP: If you have "<<money<<" Rs in your bank account, you will recive "<<moneyReceived(money, 1.1)<< " Rs after 1 year";
// return 0;
// }