Factorials

Implement a function factorial(n) that would return the factorial of the number n:
The input contains a single integer n.
The output should contain 4 numbers - n!, (2n)!, (n-1)!, (n+1)! each on a separate line.
Input
5

Output
120
3628800
24
720
 
To check your solution you need to sign in
Sign in to continue