/* This calculates the factorial of a given integer
 * result = number!
 *        = 1 * 2 * 3 * ... * number
 */

class Factorial {
    public static void main(String [] args) {
	// at first we declare some variables
    	int number = 5;		// the input number
	int i = 1;		// "running" variable
	int result = 1;		// the output
	
	while (i <= number) {
		result = result * i;
		i++;
	}
	System.out.println("The factorial of " + number + " is " + result);
    }
}
