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 18:00
Me asap! what is the slope of this line? enter your answer in the box.
Answers: 2
question
Mathematics, 21.06.2019 18:30
The base of a triangle exceeds the height by 9 inches. if the area is 180 square inches, find the length of the base and the height of the triangle.
Answers: 3
question
Mathematics, 21.06.2019 18:30
If 25% of y is 30, what is 60% of y?
Answers: 1
question
Mathematics, 21.06.2019 21:40
Which statement is true about a number and its additive inverse? a. their product is always one. b. their sum is always one. c. they are always reciprocals of each other. d. their sum is always zero.
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.03.2020 18:34
question
History, 20.03.2020 18:36
Questions on the website: 13722367