All challenges
easymath 10 XP per passing test
Factorial
Problem
Given a non-negative integer n, calculate its factorial. The factorial of a number n (denoted as n!) is the product of all positive integers less than or equal to n. For example, 5! = 5*4*3*2*1 = 120. Input is a single line containing a non-negative integer. Output is a single line containing the factorial of the input number.
(run your code to see output)
Advertisement