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]
2 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]2 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
The next generation ip version and successor to ipv4 is called what? ipv5 ipv6 iana ssl
Olenka [21]
I study IT,it was Ipv 6 in our textbook
4 0
3 years ago
Which of the following comments are correct? Select all that apply.
AnnZ [28]

Answer:

1/ hello

Explanation:

7 0
3 years ago
Cuales son los elementos de la programación?
bulgar [2K]
Sintaxis.
Código Objeto.
Depuración.
Errores de sintaxis.
Errores lógicos.
Errores de regresión.
Elementos léxicos de los programas.
Identificador.
4 0
3 years ago
Select the correct answer.
Galina-37 [17]
Functional languages
8 0
2 years ago
Melissa needs to put a topic name on her email that she will send will to her teacher . choose the name of the field
Lera25 [3.4K]

It is A. I am pretty sure

8 0
3 years ago
Read 2 more answers
Other questions:
  • Activity 1: Matched pairs or independent/separate samples? For each of the prompts below, decide whether the parameter of intere
    11·1 answer
  • Impact of computer on education
    6·2 answers
  • Which are malicious codes? <br><br> JavaScript <br> Key loggers <br> Scrum <br> Spyware <br> Worms
    12·1 answer
  • What piece of software tells the operating system how to use a specific hardware device?
    14·1 answer
  • The title bar of a window tells you the name of the document or program that's being displayed in the window, and it also serves
    11·1 answer
  • In a ring-based system, procedure p is executing and needs to invoke procedure q. Procedure q's access bracket is (5,6,9). In wh
    15·2 answers
  • FIGURE A-1—Use the information in this chart to answer Question 1.
    6·1 answer
  • REPORT THIS USER. HE'S SHOWING HIS YK WHAT TO EVERYONE INCLUDING ME. HIS ACCOUNT PROFILE IS IN THE PICTURE BELOW
    14·1 answer
  • The template code provided is intended to check whether an integer entered by the user is outside of the range 20-29 (inclusive)
    9·1 answer
  • The printer prints 16 pages every minute. How many pages are printed in 6 minutes?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!