Question: I'm doing a c++ program to create two 4x4 matrices then (a) tranpose them (b) multiply the matrices together. But I keep on getting error
I'm doing a c++ program to create two 4x4 matrices then (a) tranpose them (b) multiply the matrices together. But I keep on getting error on my program.
#include
int main() { {
int i, j, k, sum, A[4][4], B[4][4], trans_matrix[4][4], matrix[4][4]; srand (time(NULL)); cout << "Array A is: " << endl; for (int i=0; i<4; i++) { cout< for (int i=0; i<4; i++) { for (int j=0; j<4; j++) { cout << trans_matrix A[i][j] << "\t"; } cout << endl; } cout << "Array B is: " << endl; for (i=0; i<4; i++) { for(j=0; j<4; j++) { B[i][j] = rand() % 11; cout << "\t" << B[i][j]; } cout << endl; } for (int i=0; i<4; i++) { for (int j=0; j<4; j++) { trans_matrix B[i[j]=matrix B[i][j]; } } cout << "Transpose of the B Matrix: " << endl; for (int i=0; i<4; i++) { for (int j=0; j<4; j++) { cout << trans_matrix B[i][j] << "\t"; } cout << endl; } } } cout << endl; system("pause"); return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
