Hi guys so i'm creating this function to return the maximum value of an array, I have looked over everything but it still doesn't return the max value.
int max(int array[], int n){
int max = array[0];
for(int i=0; i<n; i++)
{
if (array[i] > max){
max = array[i];
}
return max;
}
}