Max value in an array

one of the test case is coming wrong why??
https://ide.codingblocks.com/s/52618

Hey, your code will not give the correct answer if all the elements of the array are negative, so instead of initializing max with with 0, initialize it with aarr[0] i.e. first element of array.