diff --git a/src/average_median/average_median.c b/src/average_median/average_median.c index 8b13789..fcb7664 100644 --- a/src/average_median/average_median.c +++ b/src/average_median/average_median.c @@ -1 +1,12 @@ +#inlcude "average_median.h" +#include +#include +#include +double average(const double *data, int n) { + double sum = 0.0; + for (int i = 0; i < n; ++i) { + sum += data[i]; + } + return sum / n; +}