factorial 🌶️
Write a method factorial that takes an int n (0 to 12) and returns n!: the product of every whole number from 1 up to n. factorial(5) is 1 2 3 4 5, which is 120, and factorial(0) is 1 (an empty product). Use a for loop.
A product starts at 1, not 0. Why?
Multiply the running product by each i from 2 up to n. If n is 0 or 1 the loop does not run, and 1 is the right answer.