Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1 (15 points) Write a C program that returns the minimum value and its location, max value and its location and average value of

Problem 1 (15 points) Write a C program that returns the minimum value and its location, max value and its location and average value of an array of integers. Your program should call a single function that returns that min and its location, max and its location and mean value of the array. Print the results in the main function (not within the array_func function). See sample code execution below. The declaration of this function is given below: void array_func (int *x, int size, int *min_p, int *minloc_p, int *max_p, int *maxloc_p, double *mean_p) /* x is a pointer to the first array element size is the array size min_p is a pointer to a variable min in the main function that holds the minimum minloc_p is a pointer to a variable minloc in the main function that holds the location where the minimum is. max_p is a pointer to a variable max in the main function that holds the maximum maxloc_p is a pointer to a variable maxloc in the main function that holds the location where the maximum is. mean_p is a pointer to a variable mean in the main function that holds the mean */ Declare the following array of integers within the main function: int data_ar[] = { -3, 5, 6, 7, 12, 3, 4, 6, 19, 23, 100, 3, 4, -2, 9, 43, 32, 45, 32, 2, 3, 2, -1, 8 }; int data_ar2[] = { -679,-758,-744,-393,-656,-172,-707,-32,-277,-47,-98,-824,-695, -318,-951,-35,-439,-382,-766,-796,-187,-490,-446,-647}; int data_ar3[] = {-142, -2, -56, -60, 114, -249, 45, -139, -25, 17, 75, -27, 158, -48, 33, 67, 9, 89, 33, -78, -180, 186, 218, -274}; Sample code execution:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mysql Examples Explanations Explain Examples

Authors: Harry Baker ,Ray Yao

1st Edition

B0CQK9RN2J, 979-8872176237

More Books

Students also viewed these Databases questions