Use the file below code and add the correct code to fill the matr2 array with the values that make it the matrix transpose of matr1. There are many examples on the Internet that show how to do this in C++ and what it should look like when it is correct.
#include
#include
#include
#include
const int ROWS = 6;
const int COLS = 7;
using namespace std;
int main()
{
srand((unsigned)time(0));
int i, j, matr1[ROWS][COLS];
for(i=0; i
{
for (j=0; j
{
matr1[i][j] = (rand()%500)+1;
cout << setw(5) << matr[i][j];
}
cout << endl;
}
cout << endl << endl;
// transpose
int matr2[COLS][ROWS];
// display second matrix
for (i=0; i
{
for (j=0; j
cout << setw(5) << matr2[i][j];
cout << endl;
}
}