Packaging TeX Live For MSYS2

Swap values of two Variables-using third variable

Swap values of two Variables-using third variable

swap values of two variables using third variable

Coding:


#Swap values of two Variables-using third
a=input("Enter variable 'a' ")
b=input("Enter variable 'b'")
c=a
a=b
b=c
print("Variables shifted",a,b,sep='\n')

This will variables using the classic method. Shifting a variable requires the creation of a third variable. This uses that method.

Related post: 

Comments