I feel like i'm doing the actual function right but i'm not sure how to actually call it to see if it is right
I keep getting an error on the call line.
I keep getting an error on the call line.
#include <stdio.h> #include <stdlib.h> double arrayAvg(double D[], int len); int main() { double arr[4] = {1.0, 2.0, 3.0, 4.0}; double value = arrayAvg(arr[], 4); printf("%f\n", value); system("PAUSE"); return 0; } double arrayAvg(double D[], int len) { double sum; double average; for(int i=0; i <= len; i++) { sum += [i]; } average = sum / (double) len; return average; }