Question: c++ please add comments This lab will do more with functions, focusing on reference parameters 1) The provided reorder.cpp file has some code for a

This lab will do more with functions, focusing on reference parameters 1) The provided reorder.cpp file has some code for a function that reorders the values in 3 parameters so that they are in ascending order. Start with a function void swap (int &vali, int &val2) that swaps the values of vall and val2. You will need a local variable to hold the value of one of the parameters to let you do this. Write the reorder function called in main(). It should call swap () to exchange values when appropriate. . Add statements to main() to be able to try out the 3 cases below Driver to test reorder() Case 1: values are already in correct order -- leave them alone 1 2 3 Case 2: first > second and first second > third 6 8 10 // Code for lab 5 // Reordering values in variables #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
