double sum(double a[], int n) /* n is the size a[] */ { int i; double sum = 0.0; for (i = 0; i < n; ++i) sum += a[i]; return sum; }