Listing 5

  double getAvg(long array[],int size){
    int count = 0;
    double sum = 0;
    while(count < size){
      sum = sum + array[count];
      count = count + 1;
    }//end while loop
    return sum/size;
  }//end getAvg
  
Listing 5