#7 - Factorial of the number

What is Factorial?

n!=nΓ—(nβˆ’1)Γ—(nβˆ’2)×…×3Γ—2Γ—1

5!=5Γ—4Γ—3Γ—2Γ—1=120

0!0! is defined to be 1.


Example 1:

Input:

N = 5

Output:

Factorial of 5 is 120


Example 2:

Input:

N = 0

Output:

Factorial of 0 is 1


Last updated