Link Search Menu Expand Document

Challenge 1: Find The Factorial

Problem Statement

The task is to print the factorial of a number n.

The factorial of a number n is the product of all numbers from 1 to n.

factorial(n)=n∗(n−1)∗(n−2)∗…∗1

factorial (3)= 3 * 2 * 1
factorial(3) = 6

Note: Assume that the negative numbers may be passed in as argument and that the factorial of a negative number should be set as zero.

Input

Integer

Output

 Integer

Sample Input

  3

Sample Output

  6