14. Python Program to Interchange the contents of two variables without using temporary variable.
How does this program work?
- In this program you will learn about how to interchange the contents of two variables without using temperory variable.
- Here we take only two varibles x and y and the content will be stored in these two variable.
- After that by using given logic we can get the output using Python.
Here is the code
x = int(input("Enter first number:"))
y = int(input("Enter Second number: "))
x = x + y
y = x - y
x = x - y
print("After Swapping: x = ", x, " y = ", y)