According to the characteristics of factorial calculation, using recursion to achieve it is very convenient.
Note that recursion is a kind of low efficiency algorithm, especially when calculate with larger operations, so give careful consideration to the circumstances in deciding whether to use it.
This is a example of algorithm I wrote when learning C# programming language.
Example: Calculate 1! + 2! + … + 10! and print out the results. Use recursion to achieve it.