Listing 5

    count = 1;
    double sum = 0;
    while(count < size-1){
      sum = sum + values[count];
      count = count + 1;
    }//end while loop
    cout << "Avg 3 middle values = " << sum/(size - 2) 
  
Listing 5