Question: C Programming // use stdio.h, stdlib.h, string.h and math.h only. Write a function that accepts an array of integers as an input, and output the

C Programming // use stdio.h, stdlib.h, string.h and math.h only.

Write a function that accepts an array of integers as an input, and output the sum of all values and the multiplication of all values. e.g. Suppose that the array contained the following values: 1 2 3 -4 5. The function should calculate and output the sum of values (i.e. 1+2+3+(-4)+5=7) and the multiplication of all values (i.e. 1*2*3*-4*5=-120).

Start by carefully writing the function prototype - put some thought into this. Think about the good programming habits, and keep in mind that a function can return only one value in C. After writing the prototype, complete the function definition and test it.

NOTE: Functions can output only one value from a function using the return keyword. In this task, your function is expected to output 2 values.

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!