1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
DIA [1.3K]
2 years ago
7

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 va

riable min. Assume that all the variables have already been declared and that x, y, and z have been assigned values.
Computers and Technology
1 answer:
padilas [110]2 years ago
8 0

Answer:

The code to this question as follows:

Code:

if(x < y) //if block that check value of x less then value of y

{

if(x<z) // inner if block that check value of x less then value of z

{

min = x;  //assign value of x in min variable

}

else // inner else block when condition is false

{

min = z;  //assign value of z in min variable

}

}

else //outer else block

{

if(y<z) //if block to check value of variable y is less then value of z

{

min = y;  //assign value of y in min variable

}

else //else block

{

min = z;  //assign value of z in min variable

}

}

Explanation:

In the given question it is defined, that an integer variable " x, y,z, and min" is declared, in which variable "x,y, and z" value is defined, and the variable is used to assign a big value.

  • To check the biggest value we use the if-else statement in which, and if block check value of x is less than then the value of y if this condition is true so, inside this another if block declares, that will check if the value of x is less then z. if this is true, it will assign the value of x in min variable else it will assign the value of z in min.
  • In the outer else part, another conditional block has used, that checks if the value of y is less than then the value of z if it is true, it assigns the value of y in min else it will assign the value of z in min.
You might be interested in
Your computer uses 4 bits to represent decimal numbers (0, 1, 2, 3 and so on) in binary. What is the SMALLEST number
lord [1]

Answer:

C

Explanation:

I believe this is because you cannot represent the number sixteen with only four binary bits. The highest you can go is 15.

8 0
3 years ago
Which term refers to the data stored in computer memory on which the processor applies to program instructions
Fed [463]
The answer is B.) variable.
3 0
2 years ago
Levi wants to run 5 commands sequentially, but does not want to create a shell script. He knows that each command is going to ta
sergeinik [125]

Answer:

um

Explanation:

what subject is this again?

3 0
2 years ago
Write the definition of a method, isReverse, whose two parameters are arrays of integers of equal size. The method returns true
Marat540 [252]

Answer:

   public static boolean isReverse(int [ ]a, int [ ]b ){

       for (int i=0;i<a.length;i++)

       {

           if(!(a[i] == b[a.length-i-1]))

               return false;

       }

       return true;

       }

Explanation:

Using a for loop, we go through the elements of the first array. The if comapres and checks if any of the values are not the same as the appropriate value on the other array, if it is so, then it is not a reverse, and we return false. else  we return true.

7 0
3 years ago
ANSWER ASAP!!! 12 POINTS!!!!! RIGHT ANSWERS ONLY
suter [353]

Answer:

B.

Explanation:

8 0
1 year ago
Read 2 more answers
Other questions:
  • The spreadsheet below shows the names years in office, and number of terms for five US presidents
    7·2 answers
  • The third wave of computing was characterized by the introduction of _____.
    10·1 answer
  • Professionals within the creative imaging fields must have which of the following items to showcase technical expertise?
    14·2 answers
  • The expression that is tested by a switch statement must have a(n) __________ value.
    12·1 answer
  • COMPUTER SCIENCE:PIXELS
    5·1 answer
  • What's a sentence with the words trickle and resume in it? they can be in any tense. Thanku​
    5·1 answer
  • What outline feature can the Navigation pane browse the document by?
    14·2 answers
  • To plan a pizza party, one may want to order enough pizza for everyone. Use the slicesPerPizza, slicesPerGuest, and totalGuests
    11·1 answer
  • Many of the first photographers were actullay scientists and inventors
    11·1 answer
  • What are the uses of plotters​
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!