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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started