/*****************************************************************
** TableOfSquares - program to demonstrate loops
**
** This program uses a 'while' loop to generate a table of squares
** of the integers 0 through 5.  The following outupt is
** generated:
**
**       ===============
**        x  Square of x
**       --- -----------
**        0       0
**        1       1
**        2       4
**        3       9
**        4       16
**        5       25
**       ===============
**
** (c) Scott MacKenzie, 2000                             
******************************************************************/
public class TableOfSquares
{
   public static void main(String[] args)
   {
      System.out.print("===============\n"
                    +  " x  Square of x\n"
                    +  "--- -----------\n");      
      int x = 0;
      while (x < 6)
      {
         System.out.println(" " + x + "       " + (x * x));
         x++;
      }
      System.out.println("===============\n");
   }
}

