Answer:
C++ Code:
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:
To change the values of a,b,c within the function, we pass the values by reference. Let us assume that number a = 3.14, b = 2.71, c = 3.04. Since a > b, values of a and b will be swapped.Now a = 2.71 and b = 3.14. Similariy, since b > c, they will be swapped. This way, we move the largest number to its correct position in the first two steps. If there are only three numbers, and the largest number is in its correct position, then for the two remaining numbers, we will only need atmost one swap to exchange their positions. hence, we perform a comparison of a > b once again to see if the b is smaller than a. if its not, then all a,b,c are in sorted order.
Answer:
Routers control traffic between networks while switches control traffic within a network
Explanation:
There are different devices involves in computer networking. These devices include hub, switch, router and other components.
Switch is used to connect the computer with in the network. It controls the traffic between different computers within the network. Different computers are connected with each other through different cables with the help of switch.
On the other hand, different LAN's connected through the cable with a router to communicate with each other. This device is used to control the traffic between different networks.
Answer:
1) B: ++ and --
2) B: 111... and on forever
Explanation:
++ and -- in most programming languages are used for incrementing(adding) by 1 or decrementing(substracting) by 1.
The code will output 111... and on forever because the while loop was not covered in curly braces.
Answer: You're going to have to put parameters.
Explanation: Anyways, the formula for solving a cone is V=
. Where r is the radius of the base of the cone and h is the height from the center of the base to the tip of the cone. You can google "cone volume formula" and google will show a cone volume calculator and you can type in the parameters.