#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