Question: In C Programming For the first problem, you write a function named addBtoA2D(..) which takes two 2D arrays and their dimension as input and update

In C Programming

For the first problem, you write a function named addBtoA2D(..) which takes two 2D arrays and their dimension as input and update the value of the first array with the sum of this value and corresponding value in the second array.

Example input case:

Arr1 = [[1,2,3], [3,4,5], [2,3,4]]

Arr2 = [[2,2,4], [1,4,6], [1,3,3]]

After calling the addBtoA2d(..) values of the arrays should be as following,

Arr1 = [[3,4,7], [4,8,11], [3,6,7]]

Arr2 = [[2,2,4], [1,4,6], [1,3,3]]

The dimension of the both arrays should be same, otherwise element wise sum is not possible. Hence, take two input from user first R and C, which means both 2D arrays Arr1 and Arr2 should be of size R by C. Then take the input from the user for each array using nested looping. Finally call the written function addBtoA2D(..) with the arrays and dimension parameters.

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!