Behavior of the program
The program reads five numbers from an input file and stores them in reverse order in an array of type long.
(The program stores the first value read from the file into the array element at index 4 and stores the last value read from the file into the element at index 0.)
Then the program displays the five values in forward order on the screen relative to the beginning of the array.
Then it writes the contents of the array into an output file in forward order.
Following this, the program computes and displays the average of the three middle values in the array.
Finally, the program closes the input file and the output file.