Array max value doubt

https://ide.codingblocks.com/s/48278 sir my only one test case is fail what is wrong in my code

Hey Neeraj, your code will not give the correct answer if all the elements of the array are negative, so to resolve this initilaize max= arr[0]; instead of max=0;.

if i try for min number what should i do

Hey Neeraj, to find min just use > sign instead of < sign in if conditionif(max>arr[i])

@sanjeetboora thankyou so much sir!