Single line swapping in Ruby

Submitted by Karthikeyan on

The values of the variables number1 & number2 can be interchanged in single line


number1 = 78
number2 = 25
print "number1 = ", number1, " number2 = ",number2
puts
number1, number2 = number2, number1
print "number1 = ", number1, " number2 = ",number2
Output

number1 = 78 number2 = 25
number1 = 25 number2 = 78