Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Management Systems

Authors: Patricia Ward, George A Dafoulas

1st Edition

1844804526, 978-1844804528

More Books

Students also viewed these Databases questions