/* This is not a complete program. */ /***** summarray: Sums specified elements of a float array ***** On entry: A is the array whose elements are to be summed, L specifies the first element of the array to include in the sum, H specifies the last element to include. On exit: Returns the sum of array elements A[L] to A[H]. */ float sumarray(float A[], int L, int H) { if (H < L) { /* nothing to sum */ return 0; /* answer 0 */ } else if (H == L) { /* one element in range */ return A[L]; /* answer is that element */ } else { /* Multiple elements */ int M; /* answer is the sum of */ M = (L+H)/2; /* the two halves */ return sumarray(A, L, M) + sumarray(A, M + 1, H); } }