Write a function named sortie that takes three integer parameters by reference and rearranges them in ascending order--the first parameter being the smallest, the third parameter being the largest.
Step-by-step explanation:
#include <stdio.h>
using namespace std;
int main()
{
cout<<"Enter 3 number";
int first, second, third;
cin>>first>>second>>third;
cout<<endl;
cout<<"Unsorted :"<<first<<","<<second<<","<<third<<endl;
sortie(first,second,third);
cout<<"Sorted :"<<first<<","<<second<<","<<third<<endl;
return 0;
}
- Three numbers are inputted from the user.
- Sortie function is used to sort the data in specified places.