Recursive functions are those functions, which call itself
within that function. A recursive function must have the following type of
A statement to test and determine whether the function is calling itself
A statement that calls the function itself and must be argument.
A conditional statement (if-else)
A return statement.
Example: Factorial of a number
This is the most famous program on recursion. Many versions
of this program are available. All programs differ only in checking conditions.
I prefer to write like the following one.