Swap with Pointers
Read two integers. Write a function swap that takes two int pointers and swaps their values. Call it from main, then print the swapped values.
Input
- Line 1: the first integer
- Line 2: the second integer
Both values fit in an int (-2^31 <= x <= 2^31 - 1).
Output
The two integers swapped, space-separated, on one line.
Examples
Input:
3
7
Output: 7 3
Input:
10
10
Output: 10 10
Input:
-3
8
Output: 8 -3
Negative numbers swap through the pointers the same as any other value.