bybi8rdanmanRed bybi8rdanmanRed
  • 08-02-2017
  • Computers and Technology
contestada

Given the integer variables x, y, and z, write a fragment of code that assigns the smallest of x, y, and z to another integer variable min.

Respuesta :

kaevras
kaevras kaevras
  • 08-02-2017
You should specify what language you're using in these types of questions. Here's an example in C++, which is fairly easy to understand, so you should be able to transfer the concept to another language to problem.

int x = 2, y = 1, z = 3, min;

if (x < y && x < z)
min = x;
else if (y < x && y < z)
min = y;
else if (z < x && z < y)
min = z;
else
std::cout << "There is no minimum";
Answer Link

Otras preguntas

7. In a food chain, concentrations of harmful substances increase in higher trophic levels in a process known as A. biological magnification. B. genetic drift
How would your life and the lives of your friends, family, and neighbors be different if suddenly a law such as the Nuremberg Law were imposed on your culture?
16a^-2b^7c^0/8a^2b^-5
Who determines the facts in a criminal trail
true or false air masses are moved by the global wind currents
Nationalism resulted in a powder keg on the Balkan Peninsula in 1914 and all that was needed was a spark to set it off. What provided this spark and set in mot
The photo above shows a landform surrounded by water on 3 sides. we can describe this landform as an
An adult blue whale can weigh as much as 150 tons. Let y represent the number of blue whales in all the oceans. Which expression represents the maximum weight i
in general, how does air move
Why is it important to select the right project before you begin working?
good job