#include using namespace std; int find_second_biggest(int *n, int len){ int max, smax; max = n[0]; for(int i = 0; i < len; i++){ if(n[i] > max){ smax = max; max = n[i]; } else if(n[i] > smax){ smax = n[i]; } } return smax; } int main(){ int numbers[5] = {1, 10, 9, 3, 4}; // The next line will print 9 cout << find_second_biggest(numbers, 5) << endl; int more_numbers[8] = {1, 2, 3, 4, 5, 6, 7, 8}; // The next line will print 7 cout << find_second_biggest(more_numbers, 8) << endl; }