Question: In C++ please Write a program that prompts the user to input 3 integer values into the computer. Write a function that re-orders the values
Write a program that prompts the user to input 3 integer values into the computer. Write a function that re-orders the values in the three integer variables such that the values occur in ascending order. Specifications: Use the following function prototype for your sorting function: void ptrSort (int *a, int *b, int c) Use the following three variables to store your numbers in the main) function: int x, y, z; Use the following three pointers to point to the three variables in the main function: int i, j. k After you have your integer variables and pointers declared, prompt the user to enter 3 numbers(1 number at a time). Read in the numbers into the variables using your pointers, and call your ptrSort O function-whose purpose is to sort the numbers so that x contains the smalest number.y contains the middle number, and z contains the largest number. Then print the results to the screen using the pointer variables. You MUST use pointers to perform ALL operations relating to scanning, sorting, and printing the numbers. If you execute the program, the following information should be displayed main.o Please enter the first number: 3 Please enter the second number:1 Please enter the third number: 2 The sorted numbers are: 1, 2, and 3. main. Please enter the first number-15 Please enter the second number: -30 Please enter the third number: 212 The sorted numbers are:-30,-15, and 212 n>
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
