Its hard to pin point what exactly you did wrong. It might be because you created a initial value for the max (I.E int max = 0) inside the for loop, that might caused you to unable to print the final max value after the loop.