Ask Question
29 October, 06:34

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.

+2
Answers (1)
  1. 29 October, 09:00
    0
    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";
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “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. ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers