back
A Function to Find the Factorial of a Number
Recall that the way to find the factorial of a number is as follows:

The factorial of 5 is:

5 * 4 * 3 * 2 * 1 = 120

In Math, we write this as follows:

n! = (n)(n - 1)(n - 2) ...

So that,

5! = (5)(4)(3)(2)(1)

Now, can you write a function that finds the factorial of a number?

Get with a partner and try to write a program. See what you can map out.

Here is one solution.