factorial

Find the factorial of a given number

int factorial(n);

will return the factorial of a given number. There is no custom return type, the function always returns an integer.

factorial(5); //120
factorial(0); //1

Last updated