1. What are functions #

Created Wednesday 23 October 2019 Suppose we need to calculate nCr. We can do this by making 3 for loops for n!. r! and (n-r)! This will take 2n steps in total. We had to do copy the code for all the three things. This is very bad because:

It is better that we have a funtion for doing repetitive tasks. This code can be debugged easily, looks good and is not bulky. This solution is called a function.

Syntax for declaring functions in C++. ouput_type name_of_the_function(input_type1 name1, input_type2, name2){ // code inside the function, called function definition }