// Factorial.java // This program calculates a factorial of an entered integer public class Factorial { public static void main ( String[] args ) { int a,b=1,c,fc; Integer in = new Integer(Integer.parseInt(args[0])); fc = in.intValue(); a = fc; do{ b = b* fc; c = b; fc--; }while(fc > 0 ); System.out.println("The factorial of " + a + " is " + b); System.out.println(); } }