#include "average.h" #include using namespace std; double avg(double array[], int length) { int count = 0; double summ = 0; double average = 0; //int length = (sizeof(array) / sizeof(array[0])); while(count < length) { summ = summ + array[count]; count ++; } //cout << "sum = " << sizeof(array) << endl; //cout << "count = " << sizeof(array[0]) << endl; //cout << "length = " << length << endl; average = (summ / length); return average; }