0
To add two matrices
write a program in c++
1 Odpowiedź
+ 16
int matrix1[3][3];
int matrix2[3][3];
int result_matrix[3][3];
// codes to input to both matrix
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
result_matrix[i][j] = matrix1[i][j] + matrix1[i][j];
}
}
// codes to output result_matrix