What is a recursion function?
In a simple word, a function which calls itself is called a recursive function. It becomes useful when you solve a problem that uses divide and conquers method. You can divide a problem and solve it recursively.Since a recursive function call itself, we need to define some condition for it so that it will stop. Otherwise, the program will run to the infinity. Usually, the 'if' statement is used to terminate the recursion.
The above code is an example of recursion function to find the factorial of the given positive integer.