- Engineering
- Computer Science
- create an array of size 7 and enter values into...
Question: create an array of size 7 and enter values into...
Question details
Create an array of size 7 and enter values into this array by passing it to a function (readValues). The function must have a pointer as a parameter to get the address of the array. In main, call a different void function (function name is minavg) to find the minimum value of this array as well as the average of all the values and return both.
*create two extra variables in main and pass the address of those variables to the function minavg
In main you should have
int min;
int avg;
minavg(list, &min, &avg, size);
Then,
void minavg(int list[], int *minptr, int *avgptr, int size)
{
int average;
calculate the average
*avgptr = average;
Solution by an expert tutor
