Question: Prob 4. Write a function called sumDiff . The function has two input array parameters one and two that have the same capacity. The capacity

Prob 4. Write a function called sumDiff. The function has two input array parameters one and two that have the same capacity. The capacity of the arrays is the third parameter of the function. The function resets entries in one and two to store the sum and difference of their earlier values. So that if at index i the values of one[i] and two[i] are initially and then when the function ends they are + and . Excessively long solutions that use more than 10 lines of code may lose points. An example of a program that calls sumDiff follows.

int main() { int one[4] = {7, 6, 8, 4}; int two[4] = {2, 6, 3, 9}; sumDiff(one, two, 4);

return 0; }

// one now stores {9, 12, 11, 13} // and two stores {5, 0, 5, -5}

(just the function ); example-

(Answer: int removeLast7(int n) { if (n == 0) return 0;

if (n % 10 == 7) return n/10; return 10 * removeLast7(n/10) + n%10;)this is an example .

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!