Question: Using the variables and statements shown below and counter-controlled loops write a set of C++ statements that print a table like the one shown below
Using the variables and statements shown below and counter-controlled loops write a set of C++ statements that print a table like the one shown below as an example. To print the table, your program must prompt the user to enter the number of rows and columns to be displayed and then use nested for loops to do it. For example, if the user enters 4 the table should look:
11 12 13 14
21 22 23 24
31 32 33 34
41 42 43 44
int max; // number of columns and rows to be displayed
int y, x; // to control the loops
cout << "Please enter maximum number of rows and columns: ";
cin >> max; cout << endl; (C++ language please)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
