Question: Write a C function (not a whole program) called sumDiff(). The function should take two parameters, a and b, with each being a 2D arrays

Write a C function (not a whole program) called sumDiff(). The function should take two parameters, a and b, with each being a 2D arrays of ints. Both arrays have a fixed size, with the number of rows and columns defined by the following constants:

#define ROWS 15

#define COLS 15

Your function should: Add each original element of b to the corresponding original element (at the same row and column) of a, storing the result in a. Subtract each original element of b from the corresponding original element of a, storing the result in b. That is, after the function runs, a should contain the sum of the original arrays (element-by-element), while b should contain the difference. The function should not return any value.

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!