Write a method that calculates the factorial of a given number.
The factorial of n is calculated by the product of integer number from 1 to n (inclusive). The factorial of 0 is equal to 1.
Write a method that calculates the factorial of a given number.
The factorial of n is calculated by the product of integer number from 1 to n (inclusive). The factorial of 0 is equal to 1.
Sample Input 1:
0Sample Output 1:
1Sample Input 2:
5Sample Output 2:
120Create a free account to access the full topic