Answer:
void swap(int number1, int number2) {
printf("Values before swapping: %d %d \\", number1, number2);
int temp;
temp = number1;
number1 = number2;
number2 = temp;
printf("Values after swapping: %d %d \\", number1, number2);
}
Step-by-step explanation:
- Print the initial values to see the change
- Declare a temporary variable temp
- Assign the value of the number1 to the temp
- Assign the value of the number2 to number1 (The first number is swapped)
- Assign the temp value to the number2 (The second number is swapped)
- Print the new values