Q2) Write a C function called SortTriple that has three integers parameters namely, low, mid, and high. After executing the function SortTriple the function will swap the values of the three parameters so that low store the smallest value of the three values, high stores the biggest value of the three values, and mid store the middle value of the three values. Q3) Write a main function to test your SortTriple will ask the user to enter the three values, then uses SortTriple to reorder the values if required. The main function should print the value in the correct order and a message to indicate if the values were in the correct order or not. Sample Input/output please enter the low value: 7 please enter the mid value: 2

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section: Chapter Questions
Problem 6PP
icon
Related questions
Question
Q2) Write a C function called SortTriple that has three integers parameters namely, low,
mid, and high. After executing the function SortTriple the function will swap the values of
the three parameters so that low store the smallest value of the three values, high stores
the biggest value of the three values, and mid store the middle value of the three values.
Q3) Write a main function to test your SortTriple will ask the user to enter the three values, then
uses SortTriple to reorder the values if required. The main function should print the value in the
correct order and a message to indicate if the values were in the correct order or not.
Sample Input/Output
please enter the low value: 7
please enter the mid value: 2
please enter the high value:4
Values were not in the correct order or place
low = 2, mid = 4, high = 7
please enter the low value: 0
please enter the mid value: 5
please enter the high value:21
Values were in the correct order or place
please enter the low value: -1
please enter the mid value: -5
please enter the high value:-7
Values were not in the correct order or place
low = -7, mid = -5, high = -1
Transcribed Image Text:Q2) Write a C function called SortTriple that has three integers parameters namely, low, mid, and high. After executing the function SortTriple the function will swap the values of the three parameters so that low store the smallest value of the three values, high stores the biggest value of the three values, and mid store the middle value of the three values. Q3) Write a main function to test your SortTriple will ask the user to enter the three values, then uses SortTriple to reorder the values if required. The main function should print the value in the correct order and a message to indicate if the values were in the correct order or not. Sample Input/Output please enter the low value: 7 please enter the mid value: 2 please enter the high value:4 Values were not in the correct order or place low = 2, mid = 4, high = 7 please enter the low value: 0 please enter the mid value: 5 please enter the high value:21 Values were in the correct order or place please enter the low value: -1 please enter the mid value: -5 please enter the high value:-7 Values were not in the correct order or place low = -7, mid = -5, high = -1
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning