A little help in displaying a high value in a loop
I've been racking my brain for about 2 hours now, so I decided to ask CProgramming for help. I have a problem I got to do for school and I have basically everything but I can't get one thing.
The problem is I need to make a loop where I keep entering temperatures. I did this by using a do-while. I then end the loop when I enter 999 as a sentinel or flag to stop. So I enter the numbers like this...
Enter temperature: 88
Enter temperature: 66
Enter temperature: 69
Enter temperature: 97
Enter temperature: 57
Enter temperature: 999
So after I did this, I ended the loop. Now I was suppose to find the average temp and the high temp. I did the average temp no problem by doing sum of values devided by how many temperatures, but I have no idea how to get the program to display the 97 as the highest temperature. A little help please. Basically I have everything and I just need to know how it displays the largest number entered in the loop. THat's the only bit of code I need. If you need me to I will post the code I currently have, I'd just have to retype it up on this comp.