#Python program on swapping the two values
a=2
b=3
print("Before swapping")
print("a=",a)
print("b=",b)
temp=a
a=b
b=temp
print("After Swapping")
print("a=",a)
print("b=",b)
output:
Before Swapping
a=2
b=3
After Swapping
a=3
b=2
a=2
b=3
print("Before swapping")
print("a=",a)
print("b=",b)
temp=a
a=b
b=temp
print("After Swapping")
print("a=",a)
print("b=",b)
output:
Before Swapping
a=2
b=3
After Swapping
a=3
b=2
No comments:
Post a Comment