102k views
0 votes
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. A program file is provided. A comment in the file indicates where the function should be written.

1 Answer

3 votes

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.
User Gyc
by
5.7k points