The factorial function can be rewritten recursively as factorial(n) = n × factorial(n – 1) . The factorial of 1 is simply 1. Code Example 6.27 shows the factorial function written as a recursive function.
The factorial function can be rewritten recursively as factorial(n) = n × factorial(n – 1) . The factorial of 1 is simply 1. Code Example 6.27 shows the factorial function written as a recursive function.