Problem Statement
Write a function int factorial(int n) that returns the factorial of n.
n! = n * (n-1) * ... * 1.
0! = 1.
DEMO-C-32 โข Programming in C
Write a function int factorial(int n) that returns the factorial of n.
n! = n * (n-1) * ... * 1.
0! = 1.
A non-negative integer.
The factorial value.
Submit runs every public testcase in this browser. Results and code never leave this device.
5
120
0
1
3
6
C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.
/workspace/question