/* 
 * Author:     Wil Schrader
 * Date:       9/3/2009
 * Version:    1.0
 * Class:      CIT 131 / Fall 2009 
 *
 * Assignment: 2) Multiplication Table
 *                Print out a 10x10 multiplication table.
 */
#include <stdio.h>

/* Main Function */
int main( void )
{
   int x = 10; /* 10 Rows */
   int y = 10; /* 10 Columns */

   /* Print out the top number row */
   printf( "\t10\t9\t8\t7\t6\t5\t4\t3\t2\t1\n" );

   /* Loop through each row (from 10 to 1) */
   while ( x >= 1 ) {

      /* Print out the right side number column */
      printf( "%d\t", x);

      /* Loop through each column in the current row */
      while ( x <= y ) {

         /* Print out the product (x*y) of the current column */
         printf( "%d\t", (x * y) );

         y--;
      } /* End While */

      /* Create a new row */
      printf( "\n" );

      y = 10;
      x--;
   } /* End While */

   return 0; /* Program ended successfully */

} /* End Main Function */
