Question: C++ write a program Write a function to add two matrices a and b and save the result in c. The header of the function

C++

write a program

Write a function to add two matrices a and b and save the result in c. The header of the function is

const int N = 3;

void addMatrix(const double a[][N],

const double b[][N], double c[][N]);

Sample run:

Enter matrix1: 1 2 3 4 5 6 7 8 9

Enter matrix2: 0 2 4 1 4.5 2.2 1.1 4.3 5.2

The addition of the matrices is

1 2 3 0 2 4 1 4 7

4 5 6 + 1 4.5 2.2 = 5 9.5 8.2

7 8 9 1.1 4.3 5.2 8.1 12.3 14.2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!