Factorial of an integer


The factorial of a number n, is given by the following:

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

5! = 5*4*3*2*1 = 120
6! = 6*5*4*3*2*1 = 720

0! = 1
1! = 1*0! = 1*1 = 1
2! = 2*1! = 2*1 = 2
3! = 3*2! = 3*2 = 6
...
n! = n(n-1)!

Write a function to do the factorial computation and return the answer to the main function.  Remember to ask the user for an integer, and output your answer.

Note: Name the file factorial.cpp

Extra Credit (1 point)
Use recursion.
Back