I know this is a simple problem but I know i'm missing something in the array but not sure what.
The assignment:
Write a function that takes an array of ints, and the size of the array (an int). It returns a double. Call this one ‘averageArray.’ Return a double that is the average of the values in the array. Demonstrate that it works by finding the average of an array with these values {78, 90, 56, 99, 88, 68, 92}
result = (double)array[7] / 7;You are accessing element with index 7 which does not exist (your array contains 7 elements with indexes of [0,6]) and it is illegal and can lead to problems.
Write a function that takes an array of ints, and the size of the array (an int)
You wrote a function that can take only arrays of 7 ints, which is not what assigment requires
average of the values in the array
Average is a sum of all values divided on values count, not some arbitrary value divided on count