//  Data Structures with Java by John R. Hubbard
//  Copyright McGraw-Hill, 2001
//  Example 4.3 on page 74
//  Iterative Implementation of Factorial Function


public class Ex0403
{ public static int f(int n)
  { int f=1;
    for (int i=2; i<=n; i++)
      f *= i;
    return f;
  }

  public static void main(String[] args)
  { for (int n=0; n<10; n++)
      System.out.println("f("+n+") = "+f(n));
  }
}
