// Produce an N x N Multiplication Table with Row and Column Headers #include void RowHeader(int); void ProduceRow(int,int); void ColumnHeader(int); void main() {int Rows,Row; cout << "Enter N, the Number of Rows and Columns >"; cin >> Rows; ColumnHeader(Rows); for (Row=1;Row<=Rows;Row++) ProduceRow(Row,Rows); } void ColumnHeader(int N) {int Column; cout << " "; for (Column=1;Column<=N;Column++){ cout.width(3); // Right justified in a field of 3 spaces cout << Column << " "; } cout << endl; // Output separators cout << " "; for (Column=1;Column<=N;Column++){ cout << " --- "; } cout << endl; } void ProduceRow(int RowNumber,int TotalColumns) {int Column; RowHeader(RowNumber); for (Column=1;Column<=TotalColumns || !(cout << endl);Column++) { cout.width(3); cout << RowNumber*Column << " "; } } void RowHeader(int RowNum) {cout.width(3); cout << RowNum << "|"; }