Assume that a function named swapdoubles has been defined and is available for use in this exercise: that function receives two variables of type double and exchanges their values. Write the definition of a function named sort3 that is passed three double

Respuesta :

Answer:

The function is given as follows;

void sort3 (double &a, double &b, double &c){

if (a>b) swapdoubles (a,b);

if (b>c) swapdoubles (b,c);

if (a>b) swapdoubles (a,b);

}

Explanation: