Okay, for my C/C++ class, I need to make a C++ program that displays multiplication tables, with the number of rows and columns for each table being entered by the user. Assume a max of a 20x20 table. The program must also support generating multiple tables, until the user chooses to exit the program. Invalid entries should result in an error message.

Basically, we're learning about looping.

Here's what I have so far...

Code:
#include <iostream>
#include <iomanip>
using namespace std;

int main () {

int x, y;

cout << "Enter the number of rows (20 max):" << endl;
cin >> x;

if(x>20){
cout << "You must enter a value less than 20. Please restart the program." << endl;
system ("pause");
abort();
       }

cout << "Enter the number of columns (20 max):" << endl;
cin >> y;

if(y>20){
cout << "You must enter a value less than 20. Please restart the program." << endl;
system ("pause");
abort();
       }
     
for(x=1; x<20; x++){
cout << setw(5) << x;
}

for(y=1; y<20; y++){
cout << setw(5) << y;
cout << endl;
}

system("pause");
}
The problem I'm having is that whether I enter 4 or 20, the table lists numbers out to 20, and it also doesn't fill in all of the rows or columns, only the first two. I imagine that's where the looping comes in to play, but I don't know how =P. Learning C++ through lectures is a terrible idea ><.

Thanks in advance!!