/* multiply3.cpp calculates and displays a multiplication table.
 *
 * Input:   LastX and LastY, the largest numbers to be multiplied
 * Output:  A list of products: 1*1 ... LastX * LastY
 *****************************************************************/

#include <iostream.h>           // cout, cin, <<, >>, right
#include <iomanip.h>            // setw()

int main()
{
   cout << "This program constructs a multiplication table\n"
           "for the values 1*1 through lastX*lastY.\n";

   int lastX,         // the largest numbers being multiplied
       lastY,
       product;       // the product of the two numbers

   cout << "\nEnter two integer limit values (lastX and lastY): ";
   cin >> lastX >> lastY;
   for (int x = 1; x <= lastX; x++)
      for (int y = 1; y <= lastY; y++)
      {
         product = x * y;
         cout << right 
              << setw(2) << x << " * "
              << setw(2) << y << " = "
              << setw(3) << product << endl;
      }

   return 0;
}


