Menu

[Solved]Include Include Define Rows 3 Change Change Rows Define Cols 4 Change Change Columnsusing Q37221303

#include <iostream>#include <string>#define ROWS 3 // change this to change rows#define COLS 4 // change this to change columnsusing namespace std;void multTable(int arr[][COLS], int, int);int main() { int arr[ROWS][COLS]; multTable(arr, ROWS, COLS); // print table created for (int i = 0; i < ROWS; ++i) { for (int j = 0; j < COLS; ++j) { cout << arr[i][j] << ” “; } cout << endl; } return 0;}void multTable(int arr[][COLS], int row, int col) { for (int a = 1; a <= row; a++) { for (int b = 1; b <= col; b++) { arr[a-1][b-1] = a*b; } }}

Modify the answer from above to store the multiplication tableup to two numbers in a 2D array named multTable. multTable must becreated, populated and tested to store the result of themultiplication of n * m in the indices [n] [m]. e.g. once multTablehas been created and populated, multTable[3][4] will return 12;

C++

Expert Answer


Answer to #include #include #define ROWS 3 // change this to change rows #define COLS 4 // change this to change columns using na… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *