1 testcase failing
- the range of numbers is quite big so to store them the dataype of array and max should be long long int.
- you are taking input for n later, but you are already declaring an array of size ānā, do you see the problem with this?
- initial value of max is set as 0. So what if there is an aray in which all the values are negative? Your code will give 0 as the max answer, even if 0 is not even present in the array. So initialise it with -infinity. It can be defined by the macro LLONG_MIN which consists the smallest possible value of the type long long int.
I have made all these changes in your code, you can see them here https://ide.codingblocks.com/s/267632
Please mark your doubt as resolved in case of no further queries 