Question: Assignment: Write a complete program that allows the user to sort different kinds of data in ascending order. More in detail: The user should be

Assignment: Write a complete program that allows the user to sort different kinds of data in ascending order. More in detail:
The user should be first prompted to type a string to select the kind of data that will be entered. The possible options are int,
double, and char; if a different string is entered the program should display the message "Invalid Option" and use the exit
function to terminate with exit code 0.
The user should be then asked to enter 2 values of the data type previously selected.
The user's numbers should be fed as separate arguments, in the same order they were entered by the user, into a function named
order that, if the first argument is greater than the second, swaps the two values.
The two numbers are printed to the screen in ascending order and separated by a space.
The function order should always accept two arguments (either of type char or int or double) and return nothing.
-6,-3
Assignment: Write a complete program that allows

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 Programming Questions!