How to write a function that receives a double array along with its length. if the number of elements of the array is odd the function returns the number that is in the middle of the array. if the number of elements in the array is even, then the function returns the average of the two numbers that are in the middle of the array.
double arrayFunction(double theArray, unsigned arraySize)
// We will use this variable to either hold the middle elements value
// or the average of the two middle elements values.
// Here the if condition should test if the size is odd
// If the size is odd we need to find the middle element.
// After we found it assign that elements value to result.
// The else portion will handle if the array size is even
// Here we need to find out the average of the two middle numbers.
// After we found it assign that value to result.
If there is anything you don't understand just let us know.