Max value in array

https://online.codingblocks.com/app/player/11915/content/54857/4796/code-challenge
https://ide.geeksforgeeks.org/u8MNOt7x5U
why is a segmentation fault coming in this question

this is because size of array is greater than max limit
and to find max element there is no need to make and array
you can achieve this by simply using a variable named max;

initialy set max=first elment
and then take input compare it with max if max is smaller than current element then update max