Question

Write a function that calculates factorial of given number?

Login to Submit

Examples

Factorial of a number is products of numbers from 1 to that number eg. 5! = 5 * 4 * 3 * 2 * 1

Input: 1
Output: 1

Input: 3
Output: 6

Input: 5
Output: 120