Factorial Function

Write a function factorial that takes an integer as an argument. It returns the factorial of a given number.

Examples

factorial(0) ➞ 1
factorial(4) ➞ 24
factorial(5) ➞ 120

Note 

  • Writing a function is compulsory for this problem. Use "factorial" as a function name.
  • Don't forget to return the result
  • Don't write recursive function 



Login is required