Join IDNLearn.com and start getting the answers you've been searching for. Find the solutions you need quickly and accurately with help from our knowledgeable community.

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:
8 3 4 2
The program must define and call a function:
void SwapValues(int& userVal1, int& userVal2, int& userVal3, int& userVal4)
Function SwapValues() swaps the values referenced by the parameters.
#include
using namespace std;
/* Define your function here */
int main() {
/* Type your code here. Your code must call the function. */
return 0;
}
C++


Sagot :

The python program is an illustration of functions.

What is a swap function?

One class can be dropped while another is added by using the word "swap." You can prevent losing your seat in one class and being unable to register for the other by switching classes rather than dropping and then adding, by function of swap values. Swapping two variables in computer programming refers to changing the values of the variables in the opposite directions.

The python program is as follows:

#This defines the function

def SwapValues(a, b, c, d):

  #This returns the swapped values

  return b, a, d, c

#Following gets input for the four integers

a = int(input())

b = int(input())

c = int(input())

d = int(input())

#This calls the SwapValues function

a, b, c, d = SwapValues(a, b, c, d)

#This prints the swapped values

print(a,b,c,d)

To learn more about function of swap values, visit:

https://brainly.com/question/29354066

#SPJ4