Question: 8. The following code needs a function called stats ). The function takes a pointer to an array of integers and returns the average value

 8. The following code needs a function called stats ). The

8. The following code needs a function called stats ). The function takes a pointer to an array of integers and returns the average value of the numbers in the array. In addition, a side effect of the function is that the values array max and array min will contain the largest and smallest value in the array after the stats function is called. You must write the stats () function, including the arguments that are passed to the function. Other than how the stats () function is called no other changes to main () are permitted. No global variables are permitted // assume this file is called my prog.c, and you make an executable file // called my prog. It is run using /my prog 1000 #include #include int main(int argc, char *argv[]) int *array; int array max, array min, array size; double array_average; int j; array size = atoi (argv [1]); array- (int *) malloc( array_size * sizeof (int)) // fill the array with random numbers for (j=0; j

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!