Browse Source

code for average

master
fdai7968 11 months ago
parent
commit
188232f732
  1. 11
      src/average_median/average_median.c

11
src/average_median/average_median.c

@ -1 +1,12 @@
#inlcude "average_median.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
double average(const double *data, int n) {
double sum = 0.0;
for (int i = 0; i < n; ++i) {
sum += data[i];
}
return sum / n;
}
Loading…
Cancel
Save