Question: C++ Question 5: (25 points) Write a C++ program to sort integer numbers in either ascending or descending order, e.g. 9, 12, 4 will be

 C++ Question 5: (25 points) Write a C++ program to sort
C++

Question 5: (25 points) Write a C++ program to sort integer numbers in either ascending or descending order, e.g. 9, 12, 4 will be sorted to 4, 8, 12 (ascending order) and 12, 9, 4 (descending order). In your program you may first ask the user if he wants to sort in ascending or descending order. Then ask the user to input up to 50 nonnegative whole numbers to be sorted followed by a -1 to indicate the user finished inputting the numbers. At the end of the program you will display to the user the set of numbers he/she has entered and the sorted version of it either in ascending or descending order, whatever he/she has chosen. Hint: you may use an array or a vector to store the input variables

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!