/* This program 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>
#include <iomanip.h>

int main(void)
{
   cout << "\nThis program constructs a multiplication table,\n"
        << "\tfor the values 1*1 through X*Y.\n";

   int
      LastX,         // the largest numbers being multiplied
      LastY,
      Product;       // the product of of the two numbers

   cout << "\nPlease enter two integer limit values "
           "(one for X, one for Y): ";
   cin >> LastX >> LastY;

   for (int X = 1; X <= LastX; X++)
      for (int Y = 1; Y <= LastY; Y++)
      {
         Product = X * Y;
         cout << setw(2) << X << " * "
              << setw(2) << Y << " = "
              << setw(3) << Product << '\n';
      }

   return 0;
}
