A good answer might be:
| |
Finding the Minimum in an ArrayWith a ten-element initializer list the buggy program might fail just one time in ten (assuming various 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 (not an uncommon length), the program will fail only once in ten thousand times, on the average! Off-by-one errors can be very subtle. Here is a program that finds the minimum of an array. It is similar in basic style to the maximum-finding program:
| |
QUESTION 11:Click Here after you have answered the question |