#include <stdio.h>
#define SIZE 3

/*
 * Program to average numbers from an array
 * Terry Harvey CISC 105 section 98 TA Janet
 */

int main(){

    double data[SIZE] = {3,5,67,8,6,4,3,2.7,3.2,9};

    int i = 0;
    /* Could total be an int type here?  */
    double average, 
           total = 0;
    
    for (i = 0; i < SIZE; i++){
        total = data[i] + total;
        /* Are the parentheses necessary in the next line? */
        printf("running average is %lf\n", total / (i+1));
    }

    average = total / SIZE;

    printf("The average is: %lf\n", average);

    return 0;
}
