Factorial Calculator (n!)

Factorials Calculator
Answer:

How the Factorial Calculator (n!) works:

The Factorial Calculator computes the factorial of a given positive integer nn. The factorial of a non-negative integer nn is the product of all positive integers less than or equal to nn. This calculator supports large factorials and uses BigInt for precise calculations, ensuring accurate results even for larger values of nn.

Formula:

The factorial of nn, denoted as n!n!, is defined as:

n!=n×(n1)×(n2)××1n! = n \times (n – 1) \times (n – 2) \times \dots \times 1

Where:

  • n!n! is the factorial of nn.
  • nn is a non-negative integer.
Examples:
  1. Example 1:

    • Input: n=5n = 5
    • Calculation: 5!=5×4×3×2×1=120
    • Output: 5!=1205! = 120
  2. Example 2:

    • Input: n=10n = 10
    • Calculation: 10!=10×9×8×7×6×5×4×3×2×1=3,628,80010! = 10 \times 9 \times 8 \times 7 \times 6 \times 5 \times 4 \times 3 \times 2 \times 1 = 3,628,800
    • Output: 10!=3,628,80010! = 3,628,800
  3. Example 3:

    • Input: n=20n = 20
    • Calculation: 20!=20×19×18××1=2,432,902,008,176,640,000
    • Output: 20!=2,432,902,008,176,640,00020! = 2,432,902,008,176,640,000
    Advertisements