Previous
Functions
5 / 6
Next
Recursion
Hint
The factorial $n! = n \cdot (n-1) \cdot \dots \cdot 2 \cdot 1$ can be described recursively:
$$ n! = n \cdot (n-1)! $$
As an example, consider
$$5 = 5 \cdot 4 \cdot 3 \cdot 2 \cdot 1 = 5 \cdot 4!$$
Define the function fac
that computes the factorial of a number n
recursively.
Help
Solve
Reset
Test results
Test result #
Expected output
Your output