Calculate n! (n factorial), the product of all positive integers up to n, commonly used in combinatorics and probability.
Formula
n! = n × (n−1) × (n−2) × ... × 1