Question
//argv [1]: number of rows in the matrix 1 (r1) //argv [2]: number of columns in the matrix 1 (c1) //argv [3]: number of rows
//argv [1]: number of rows in the matrix 1 (r1)
//argv [2]: number of columns in the matrix 1 (c1)
//argv [3]: number of rows in the matrix 2 (r2)
//argv [4]: number of colums in the matrix 2 (c2)
cout << "Multiply matrix"< cout << endl; int * * matrix3 ; matrix3 = new int *[r1]; for (int i = 0; i { *(matrix3 + i) = new int [c2]; // the column } for (int r3 = 0; r3 < r1; r3++) { for (int c3 = 0; c3 < c2; c3++) { int sum = 0; for ( int a = 0; a < c1; a++) { sum += (*(*(matrix1 + r3) + a) * (*(*(matrix2 + a) + c3))); } *(*(matrix3 + r3) +c3) = sum; cout << *(*(matrix3 + r3) + c3) << " "; } cout << endl; } Why does it not display the result for multiply matrix?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started