public class PrintFactorials
{
  public static void main (String[] args)
  {
    int limit = 10;
    int counter = 1;
    int product = 1;
    
    while (counter <= limit)
    {
      System.out.println("The factorial of " + counter + 
                         " is " + product);
      counter = counter + 1;
      product = product * counter;
    }
    System.out.println("End of demonstration");
  }
}

