Calculate the factorial (n!) of any non-negative integer. Factorial is the product of all positive integers less than or equal to n.
The factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n.
n! = n × (n-1) × (n-2) × ... × 2 × 1
0! = 1 (by definition)
5! = 5 × 4 × 3 × 2 × 1 = 120
10! = 3,628,800