while loops?

okay for uni i got given a question in class, i am at a loss at how to solve it i understand that i need to put boundaires in and average my loop but i don't know exactly what to write...i also have to make the loop reset if -1 is used which is easy enough....

i am using visual studio 2010 ultimate the program in in win32 with its source file being a .cpp


this is the question.


Write a program in C that uses a while loop to continue looping until the user enters ‘-1’. Make the program get an integer number from the user each loop and add it to a total. Average the values each loop. Print out a message indicating the current total and average each loop. If the value exceeds 2000 then reset the total and start from 0. Print out a message indicating this has happened. If the user enters a number less than 1 then discount the number and print out a message indicating the number is invalid. If the user enters a value that is not a number the discount the value and print out a message indicating the value is not a number.



any helpful link/video or advice would be nice or even an example....i dont want the entire quesion answered as that defeats the point of learning how to do it in my opinion just need some help.
Topic archived. No new replies allowed.