-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path17_a_Inline_Functions.cpp
More file actions
30 lines (24 loc) · 1.19 KB
/
Copy path17_a_Inline_Functions.cpp
File metadata and controls
30 lines (24 loc) · 1.19 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
#include<iostream>
using namespace std;
// We define inline functions...!!
inline int product(int a, int b){
return a*b;
}
int main()
{
int a, b;
cout << "Enter the value of a and b : " << endl;
cin >> a >> b;
// When we call this function many times then -- toh pehle toh a and b copy honge then vo sab function se pass ho kar return me product denge and then vo cout print karega so all this things takes a lot of time if we see at compiler level so for that we USE INLINE FUNCTION....!!
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;
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;
return 0;
}