● Upload the program before June 6 • Spec: - User inputs two 2x2 matrices. The program multiplies these two matrices and
Posted: Mon Jun 06, 2022 1:23 pm
#include using std::cout; using std::cin; using std::endl; #include using std::setw; Bint main() { const int size = 2; int mat1[size][size] = { 0 }; int mat2[size][size] = { 0 }; int* pproduct = new int[size * size]; // read the matrices cout << "\nPlease input 1st matrix:" << endl; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) cin >> *(*(mat1 + i) + j); cout << "\nPlease input 2nd matrix:" << endl; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) cin >> *(*(mat2 + i) + j); // show the matrices cout << "\nMatrix1 is:" << endl; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) cout <