subject
Mathematics, 13.11.2019 00:31 naocarolina6

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 variables . the function returns nothing but modifies the values of these variables so they are in sorted order. so, if a, b and c have (respectively) the values 3.14, 2.71, and 3.04, and the invocation sort3(a, b,c) is made, then upon return, the values of a, b and c will be 2.71, 3.04, and 3.14 respectively.
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);
}

ansver
Answers: 2

Another question on Mathematics

question
Mathematics, 21.06.2019 15:30
What is the value of y? round to the nearest tenth
Answers: 2
question
Mathematics, 21.06.2019 19:30
If you could answer these your a life saver
Answers: 1
question
Mathematics, 21.06.2019 20:00
Adam used 1072.4 gallons of water over the course of 7 days. how much water did adam use, on average, each day?
Answers: 1
question
Mathematics, 21.06.2019 22:30
Ron has 8 caps and 4 of his caps are blue. thes rest of his cap are red. how many of ron's caps are red
Answers: 1
You know the right answer?
Assume that a function named swapdoubles has been defined and is available for use in this exercise:...
Questions
question
Mathematics, 20.06.2020 01:57
question
Health, 20.06.2020 01:57
question
Mathematics, 20.06.2020 01:57
question
English, 20.06.2020 01:57
question
Mathematics, 20.06.2020 01:57
question
Mathematics, 20.06.2020 01:57
question
Mathematics, 20.06.2020 01:57
question
Mathematics, 20.06.2020 01:57
question
Mathematics, 20.06.2020 01:57
question
History, 20.06.2020 01:57
question
Mathematics, 20.06.2020 01:57
question
Medicine, 20.06.2020 01:57
Questions on the website: 13722363