Print Factorial of a number

The factorial of a non-negative integer n, denoted by n! is the product of all positive integers less than or equal to n. For example:

5! = 5 * 4 * 3 * 2 * 1 = 120

The program asks the user to input the number and calculates using the above method. In this program we use a recursive function to calculate the factorial of a number. A recursive function is a self-calling function, which calls itself unless the condition is false. This is the easiest method to calculate factorial of number.