With a ten-element initializer list, the buggy program will fail about one time in ten (assuming random lists of data). It might not even be clear when it did fail, because the answer it computes is close to the maximum. With a ten thousand element array, the program will fail about one time in ten thousand! Off-by-one errors can be very subtle.
Here is a program that finds the minimum of an array. It is similar to the maximum-finding program:
Fill in the blanks. Select from the following phrases.
array[8] array[0] array[ index ] > min < min min = index++
(Hint: only some of the phrases are used.)