Question :
Write a program to find the factorial of a number using recursive function

Program:

Explanation:
Factorial of a number is the product of all natural numbers till that number. It does not exist for negative numbers.

For example, the factorial of 4 would be 1*2*3*4=24

A recursive function is a function that calls on itself. In the above recursive function, the function calls on itself with n-1 as argument till n becomes 1 and 1 is returned. Each time the function is called, product the corresponding n and the factorial of n-1 is returned. Hence, factorial is found.

Output:
1.

2.
3.
Do share your feedback in comments to help us adding more programs like this.

Checkout more Python Programs

Click here

Leave a Reply

bodrum escort - eskişehir esc - mersin escort - mersin escort bayan - mersin esc