Functions
Use of functions
- Functions are set of code wich performs somethig for you
- Functions are used to modularised code
- Functions are used to increase readability
- Functions are used to use same code multiple times
Type of functions
- void → which does not return annything
- parameterised
- non parameterised
- return
- Pass by Value
- Pass by Refrence
Void - Non_Parameterised¶
Void - Parameterised¶
Return - Parameterised¶
Pass by Value¶
Pass_by_Value.cpp
Input: 10
Output: 15
20
10
Pass by Refrence¶
Pass_by_Refrence.cpp
Input: 10
Output: 15
20
20