If you want to calculate a factorial use the iterative algorithm. The recursive algorithm is included because factorial highlights the differences between iterating and recursing nicely.

## Iterative

$n!=\prod_{k=1}^n k \!$

## Recursive

$% 0. \end{cases} %]]>$