Maximum value in an array

what is wrong with the code, it is giving me a run-time error