9511_workbook

solved exercises from algorithms & programming I (9511) prof. Cardozo
Index Commits Files Refs README
guia05/ex09.c (197B)
   1 #include "ex09.h"
   2 
   3 double arithmetic_mean(double *arr, size_t len)
   4 {
   5     if(arr == NULL) return -1;
   6 
   7     double sum = 0;
   8     for(size_t i = 0; i <= len; i++)
   9         sum += arr[i];
  10     
  11     return (sum / (len + 1));
  12 }