/* * CS 161-020, Lecture 19, Winter 2020 * Find the maximum value in an array * Author: Kiri Wagstaff * Date: February 19, 2020 */ #include #include /* include to allow rand() to be used */ #include /* include to allow time() to be used */ using namespace std; int main() { srand(time(NULL)); /* Static array */ const int n_people = 5; int height[n_people]; /* Initialize heights with random values */ for (int i=0; i height[tallest]) tallest = i; cout << "Tallest person: index " << tallest << " (" << height[tallest] << " inches)" << endl; return 0; }