basics · beginner · ~15 min
Track a running maximum.
Implement int array_max(const int *a, int n) returning the largest element. n >= 1.
int array_max(const int *a, int n) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.