subject

Swapping Values in C++

In this lab, you complete a C++ program that swaps values stored in three int variables and determines maximum and minimum values. The C++ file provided for this lab contains the necessary variable declarations, as well as the input and output statements. You want to end up with the smallest value stored in the variable named first and the largest value stored in the variable named third. You need to write the statements that compare the values and swap them if appropriate. Comments included in the code tell you where to write your statements.

Instructions

Ensure the Swap. cpp file is open in your editor.

Write the statements that test the first two integers, and swap them if necessary.

Write the statements that test the second and third integer, and swap them if necessary.

Write the statements that test the first and second integers again, and swap them if necessary.

Execute the program by clicking the "Run Code" button at the bottom of the screen using the following sets of input values.

101 22 -23
630 1500 9
21 2 2

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:00
Which parts of a presentation should be the most general? a. introduction and conclusion b. introduction and outline c. outline and conclusion d. outline and body
Answers: 1
question
Computers and Technology, 22.06.2019 21:30
How do you take a green screen out of the video while editing?
Answers: 2
question
Computers and Technology, 23.06.2019 12:20
When guido van rossum created python, he wanted to make a language that was more than other programming languages. a. code-based b. human-readable c. complex d. functional
Answers: 1
question
Computers and Technology, 24.06.2019 12:50
When is it most apprpriate for a development team to change the definition of done
Answers: 1
You know the right answer?
Swapping Values in C++

In this lab, you complete a C++ program that swaps values stored...
Questions
question
Mathematics, 17.10.2019 22:30
Questions on the website: 13722359