int getMax(int* array, int length){ int max = array[0]; for(int i = 1; i < length; i++){ if(array[i] > max) max = array[i]; } return max; }