This is a simple program to Swap 2 Numbers, which are accepted into the variables ‘a’ and ‘b ’.
First of all, we ask the user to enter the first number and the second number.
Then we accepted integer values for the variables ‘a’ and ‘b’.
Click here to know more about ‘how to enter values’.
Now look at the code snippet:
Here we just assigned,
The value of the variable ’b’ into a new variable ‘c’.
The value of ‘a’ to ‘b’.
Then the value of ‘c’ to ‘a’.
The we used the ‘print()’ to display the output.