All you did on line 12 is display the value of highest. You never set it to anything. Initialize the value of highest to 0 before the loop starts, then when the if condition is true set highest = x
you also need to incude <iostream> at the top of your program and add the using namespace std; statement or add [icode]std::[/b] before each cin statement. I use the using statement because it doesn't require as much typing, but many programmers don't like that. Unless your teacher says otherwise its your call which way to do it.
Last edited by Ancient Dragon; Feb 26th, 2008 at 7:02 pm.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Offline 21,950 posts
since Aug 2005