Answered by AI, Verified by Human Experts
Create functionSwapValueswith 4 integer parameters that swaps the 1st with 2nd and 3rd with 4th values. Read and print swapped values.In C++, we can define the function SwapValues() that takes fourinteger parametersas references.The function swaps the first with the second, and the third with the fourth values.We can then write a main program that reads four integers from input, calls theSwapValues() functionpassing in the input integers as arguments, and then prints the swapped values on a single line separated by spaces.Here's how the SwapValues() function can be defined:void SwapValues(int& userVal1, int& userVal2, int& userVal3, int& userVal4) {int temp = userVal1;userVal1 = userVal2;userVal2 = temp;temp = userVal3;userVal3 = userVal4;userVal4 = temp;}And here's themain program:int main() {int num1, num2, num3, num4;cin >> num1 >> num2 >> num3 >> num4;SwapValues(num1, num2, num3, num4);cout << num1 << " " << num2 << " " << num3 << " " << num4 << endl;return 0;}When given the input '3 8 2 4', the program will output '8 3 4 2'.For more such questions onSwapValues:brainly.com/question/28809963#SPJ11...