Computers and Technology
Computers and Technology, 24.03.2020 05:36, sophiaa23

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

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 21:00, brockmorrison3468
Is it ok to use a does red wine clean the inside of a computer true or false
Answers: 2
image
Computers and Technology, 22.06.2019 16:20, Aleja9
It policy compliance and emerging technologies respond to the following: propose at least three control measures that organizations need to put in place to ensure that they remain complaint with emerging technologies and in a continually changing it environment. examine the correlation of effective configuration management and change control procedures to remain compliant with emerging technologies and it security changes.
Answers: 2
image
Computers and Technology, 23.06.2019 04:00, ittmanny6138
Laire writes a letter to her grandmother, in which she describes an amusement park she visited last week. she adds pictures of that place in her letter. which feature of a word processing program will claire to remove unwanted parts of the pictures?
Answers: 3
image
Computers and Technology, 23.06.2019 08:30, Calirose
When you interpret the behavior of others according to your experiences and understanding of the world your evaluation is
Answers: 1
Do you know the correct answer?
Swapping Values in C++

In this lab, you complete a C++ program that swaps values stored...

Questions in other subjects:

Konu
Mathematics, 01.12.2019 03:31
Konu
Mathematics, 01.12.2019 03:31
Konu
Mathematics, 01.12.2019 03:31