Multiplies m1 by m2 if these matrices are conformable Otherwise, displays an error message and sets m1's size to 0 x 0

What will be an ideal response?


```
Matrix& operator*= ( Matrix& m1, // input/output
const Matrix& m2 ) // input
{
int val, i, j, k;
Matrix prod;

if (m1.cols != m2.rows) {
cout << "Matrices are not conformable." << endl;
prod.rows = 0;
prod.cols = 0;
} else {
prod.rows = m1.rows;
prod.cols = m2.cols;
for (i = 0; i < prod.rows; ++i)
for (j = 0; j < prod.cols; ++j) {
val = 0;
for (k = 0; k < m1.cols; ++k)
val += m1.mat[i][k] * m2.mat[k][j];
prod.mat[i][j] = val;
}
}
m1 = prod;
return m1;
}

```

Computer Science & Information Technology

You might also like to view...

How many elements can be stored in the following array? float salaries [4] [3] [50];

What will be an ideal response?

Computer Science & Information Technology

A JSlider cannot display which of the following:

a. Major tick marks. b. Minor tick marks labels. c. Minor tick marks. d. Snap-to ticks.

Computer Science & Information Technology

What is an upgrade installation? What are its limitations?

What will be an ideal response?

Computer Science & Information Technology

Templates begin on the ________

A) Title slide B) slide master C) PowerPoint master D) Presentation handout

Computer Science & Information Technology