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
Think about the pseudocode that you developed for your adventure game in this unit. Would it have been easier to create a flowch
katovenus [111]

Answer:

it may not be easy

Explanation:

because am using a phone not a cuputer

5 0
2 years ago
1.
Anna11 [10]
1. True
2. False
3. True


Have a great day <3
3 0
3 years ago
Convert the decimal number -12 to hexadecimal (2's complement)
Helga [31]

Answer:

FFF4

Explanation:

Binary representation of 12 = 00001100

Expressing it in hexadecimal format : 0C

Binary representation of -12:

Step 1 : Computing 1's complement for 12 =11110011

Step 2 : Adding 1 to 1's complement to get the 2's complement =>

11110011+1 = 11110100

Converting the 2's complement representation to hexadecimal format:

F4 ( 8 bit representation) or FFF4 ( 16 bit representation)

4 0
3 years ago
What contains the computer's "brain," the central processing unit (CPU).
vodomira [7]

The computer brain is a microprocessor called the central processing unit (CPU). The CPU is a chip containing millions of tiny transistors.

6 0
3 years ago
How would you a get a large company to donate a school bus to your renewable energy program?
ZanzabumX [31]

Answer: give them a call i guess

Explanation:

6 0
3 years ago
Other questions:
  • A friend complains that she is always running out of money even though she “never buys anything expensive.” What advice would yo
    10·1 answer
  • Which term refers to an interface between HTML elements and JavaScript program code that allows JavaScript code to manipulate HT
    12·1 answer
  • Give one advantage and two disadvantages of using a wireless network
    8·1 answer
  • What do you call a set of programs?
    7·1 answer
  • What layer in the Transmission Control Protocol/Internet Protocol (TCP/IP) model is responsible for defining a way to interpret
    11·1 answer
  • What does the binary odometer show about representing large numbers​
    15·1 answer
  • For safety, the lights on your vehicle must be in good working condition. Which statement about
    8·2 answers
  • Wanna play pubg<br><br><br>ill send u my id​
    5·2 answers
  • (100 points) why does file explorer look like this and how do I fix it? I'm not good with computers, and I kinda need help
    13·1 answer
  • The four levels of FBLA membership
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!