You need to indent properly and add some whitespace to make it more readable:
Code:
#include <iostream>
using namespace std;
int main()
{
int number;
int othvar;
int highest = 0;
int second = 0;
cout << "How many numbers? ";
cin >> number;
cin >> othvar;
int rec = othvar;
second = othvar;
for (int track = 1; track < number; track++)
{
cin >> othvar;
if (rec < othvar)
rec = othvar;
if (second < othvar && second < rec)
second = othvar;
}
highest = rec;
int sprint = second;
cout << endl;
cout << "Highest: " << highest;
cout << endl;
cout << "Second: " << sprint;
}
Your logic flawed, and that's why it won't work. Grab a debugger and step through it or step through it manually. If I give you the sequence 1, 5, 3, why does it fail?