A good answer might be:The complete program is given below. | |
Complete Max Program
Here is the program.
Carefully examine how the
It is well worth your time to "copy-paste-and-run" this program. Once you have it running see if you can "break" it by initializing the array to different values:
Here is a classic bug for this type of program:
Change the test part of the loop to
The program is now suffering from the notorious "off-by-one" error---the most
common bug in programming.
| |
QUESTION 10:
|