Example 3: Swap Two Variables
Learn how to interchange the contents of two variables with each other.
We'll cover the following...
Problem
Write a program to interchange the contents of two variables, x and y, and print their values on the console.
Example
Input (x , y) | Output (x , y) |
---|---|
50 , 100 | 100 , 50 |
25 , 30 | 30 , 25 |
Try it yourself
Try to solve this question on your own in ...