Swap the two Numbers (interchange the value) without using third variable.
5) Write a program to input two number
and Swap the Numbers (interchange
the value) without using third variable.
a=int(input("enter the first number : "))b=int(input("enter the second number : "))print("before swaping no. :")print("a= ",a)print("b= ",b)a=a+bb=a-ba=a-bprint("after swaping no. :")print("a= ",a)print("b= ",b)
![]() |
swap-two-numbers-without-using-third-variable |
Comments
Post a Comment