Factorial Program in Java

Factorial Program in Java: Factorial of n is the product of all positive descending integers. Factorial of n is denoted by n!. For example:

4! = 4*3*2*1 = 24

5! = 5*4*3*2*1 = 120

class Faactorial
{
public static void main(String args[])
{
int value = 5;
int sum = 1;
while(value>0)
{
sum = sum * value;
value--;
}
System.out.println(sum);
}
}