go online. whatever you are trying to do, someone has already done it and posted the code.
just write a loop that traverses the array, saving the index of biggest value so far.
Presumably, you will also need to display the person and age found.
Write a program which finds the age and name of the oldest person in a group.
const int SIZE = 8;
int age[SIZE] = { 21, 42, 26, 22, 35, 13, 18, 39 };
string name[SIZE] = {“Mark”, “Rebecca”, “Fred”, “Alfred”, “Waldo”, ”Sue”, “Mary”, “Darrin”};
You must use the computer to write this program. You must use arrays and functions to write this program.
Note: The data should not be able to be changed inside the function.
1 answer