An online store lets shoppers filter products by a minimum and maximum price. If someone mistakenly enters 80 as the minimum and 20 as the maximum, the filter shows nothing, and the shopper assumes the store is empty.
Instead of showing nothing, the filter can swap the two values when they arrive in the wrong order. That’s your job here.
Write a function with this exact signature:
void orderRange(double* low, double* high);It should meet these requirements:
low must be less than or equal to the value pointed to by high.Entered 20 to 80 -> filter 20 to 80
Entered 80 to 20 -> filter 20 to 80
Entered 45 to 45 -> filter 45 to 45
Entered 19.99 to 5 -> filter 5 to 19.99