Need a hint as to how to make a program that prints two highest numbers from user inp
ut. (the title bar wasn't long enough :P) Anyways, that sums it up. I need to write a program where a user inputs a bar of numbers, and the two highest ones are printed. Now, I have the input working correctly, but I can't figure out the two highest numbers thing. The input cins are inside a loop that runs <inputed variable> number of times, but I can't figure out how to count the highest and second highest- or just the highest for that matter. Below is my current code which just prints 0, if someone could give me a hint as to what to do (I tried putting various things inside the loop to try and record the highest, didn't work) that would be appreciated.
Code:
#include <iostream>
using namespace std;
int main ( ) {
int number;
int othvar;
int highest = 0;
cout << "How many numbers? ";
cin >> number;
for(int track = 0; track < number; track++) {
cin >> othvar;
}
cout << "highest: " << highest;
}