how to display three (+ve) numbers in asending orders

I was given a assingment to complete on dev c++ but i am having difficulty to do so. could someone plz tell me how to do this on dev c++?

>Develop a console based C++ program called sort.cpp that asks the user to input three positive
whole numbers, and then displays the numbers in ascending order.
The program should ask the user to input three whole positive numbers in the range 0 to 1000.
If the user enters valid numbers, the program should determine the lowest of the numbers and
display this number, then display the next lowest number and finally the highest of the numbers
should be displayed. If the user enters an invalid value for any of the numbers, an error message
should be displayed and the program terminates.
Compile, run and test your program for a number of test cases, including both valid and invalid
input data


i would need something like this:
#include <iostream>
using namespace std;
int main
{
//program.....
return 0;
}
The program should ask the user to input three whole positive numbers in the range 0 to 1000.

http://www.cplusplus.com/doc/tutorial/basic_io/

If the user enters valid numbers, the program should determine the lowest of the numbers and display this number, then display the next lowest number and finally the highest of the numbers should be displayed. If the user enters an invalid value for any of the numbers, an error message should be displayed and the program terminates.

http://www.cplusplus.com/doc/tutorial/control/

The above should be enough to get you started. Note that we're not here to help you complete your homework, though we can help you with anything specific that's holding you back.
Last edited on
Topic archived. No new replies allowed.