Flikerator wrote:
We got a booklet of questions today and I finished them all in like 20 mins... There was a question that wanted to enter an unknown length of numbers from the user not a file. It then wanted the sum, average, highest, and lowest numbers.
I used a flexible array, it was very easy that way. How would you go about doing that? Help me get in your mind XD
Perhaps he's asking how to do it without using flexible arrays?
In that case, keep a running tally of the sum and the number of numbers inputted so far. Also have a variable called lowest and another called highest that begin at maxint and minint, respectively. If the number inputted is > lowest, make lowest equal to that number. Similarly for highest.