If N is an integer greater than 0, n factorial (n!) is the product: n × (n-1) × (n-2) × (n-3) × ... × 1.
By convention, 0 != 1.
You must write a program that allows a user to enter an integer between 1 and 7. Your program must then compute the factorial of the number entered by the user.
The input starts with an integer N (N ≤ 50).
Print the result of N! (N factorial).
Input | Output |
---|---|
4 | 24 |