C++ 6.25 LAB: Swapping variables

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

C++ 6.25 LAB: Swapping variables

Post by answerhappygod »

C++ 6.25 LAB: Swapping variables
C 6 25 Lab Swapping Variables 1
C 6 25 Lab Swapping Variables 1 (71.33 KiB) Viewed 69 times
6.25 LAB: Swapping variables Define a function named SwapValues that takes four integers as parameters and swaps the first with the second, and the third with the fourth values. Then write a main program that reads four integers from input, calls function SwapValues() to swap the values, and prints the swapped values on a single line separated with spaces. Ex: If the input is: 3 8 2 4 function SwapValues()) returns and the main program outputs: 8342 The program must define and call a function: void SwapValues (int& userVall, int& userVal2, int& userVal3, int& userVal4) Function SwapValues() swaps the values referenced by the parameters. 406896.2611930.qx3zqy7 LAB ACTIVITY 6.25.1: LAB: Swapping variables 0/10 main.cpp Load default template... 1 #include <iostream> 2 using namespace std; 3 4 /* Define your function here */ 5 6 int main() 7 /* Type your code here. Your code must call the function. */ 8 9 return 0; 10
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply