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
lubasha [3.4K]
3 years ago
13

Given the int variables x, y, and z, write a fragment of code that assigns the smallest of x, y, and z to another int variable m

in. Assume that all the variables have already been declared and that x, y, and z have been assigned values.
Computers and Technology
1 answer:
Marysya12 [62]3 years ago
6 0

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables

   int x=5,y=2,z=9;

   int min;

   // find the smallest value and assign to min

   // if x is smallest

   if(x < y && x < z)

   // assign x to min

    min=x;

     // if y is smallest

else if(y < z)

 // assign y to min

    min=y;

// if z is smallest

else

 // assign z to min

    min=z;

// print the smallest

cout<<"smallest value is:"<<min<<endl;

return 0;

}

Explanation:

Declare and initialize variables x=5,y=2 and z=9.Then check if x is less than y and x is less than z, assign value of x to variable "min" .Else if value of y is less than value of z then smallest value is y, assign value of y to "min".Else z will be the smallest value, assign its value to "min".

Output:

smallest value is:2

You might be interested in
What are some good job skills?
Aneli [31]

Answer: some good skills to have at a job are: Able to work in a team. Another is to be able talk to others in a clear, kind voice that they can understand. I would say that the skills you need depend on what job you have. Some hands on, some computer skills, talking skills, it depends.

Explanation:

6 0
3 years ago
Which of the following is the primary medium for beach erosion?
Serhud [2]
The answer is C. I think.
4 0
3 years ago
In MS Word we can merga cells true or false​
sergey [27]
In this video I showed you all of the locations for all items in Wacky Wizards!! I hope you enjoyed and please like and subscribe. Piece out!!!
7 0
2 years ago
Read 2 more answers
0.005098 megaliters to liters. record your answer in whole liters
Dmitriy789 [7]
Your answer would be 5098 liters.

Reason being, because there are 1,000,000 liters in one megalitre, so you just multiply 0.005098 by 1,000,000 to get your answer of 5098 liters.
6 0
3 years ago
Help me i'll brainiest if its right
Dominik [7]

Answer:

Your response is correct.

I hope this helped at all.

4 0
2 years ago
Read 2 more answers
Other questions:
  • The fast food restaurant Chipotle pulled its app from Apple's app store when customer demand caused the firm's servers to crash.
    14·1 answer
  • How to turn a flash drive into a bluetooth adapter?
    13·1 answer
  • #We've started a recursive function below called #measure_string that should take in one string parameter, #myStr, and returns i
    5·1 answer
  • 1. Access and PowerPoint are not included in all configurations of Microsoft Office 2013.
    14·1 answer
  • What are the key ideas in dealing with a superior?
    9·1 answer
  • True or false? Colons are required when entering the MAC address into the Reservation window?
    14·1 answer
  • Which of the following types of computers is typically used by governments and hospitals and can support hundreds of users?
    6·2 answers
  • Caps lock key is used to type alphabets. _________​
    6·2 answers
  • ...............is a personal computer that fits on desk.​
    5·2 answers
  • A class is a type of object that defines the format of the object and the actions it can perform. True False
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!