swap the two numbers program in python

4)   Write a program to input two number and Swap the Numbers (interchange the value) 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)

c=a
a=b
b=c

print("after swaping no. :")
print("a= ",a)
print("b= ",b)


swap-two-numbers-program-in-python

Comments

Popular posts from this blog