Factorial Calculation
Asked at Grammarly · Coding Questions · Difficulty: Easy · Last asked Jul 15, 2026
Implement a function to compute the factorial of a given non-negative integer n. Ensure the function handles valid input and can process large integers. Test cases: input 2, output 2; input 5, output 120; input 10, output 3628800.
Loading the problem…