human
Give me a code to how to swap two numbers without using a temporary variable given the following:
How to swap two numbers without using a temporary variable ? | Function to swap the numbers.
Same as a = a + b.
Same as b = a - b.
Same as a = a - b.
Driver code.
Function call"
Solution in Python:
assistant
#Here is code to how to swap two numbers without using a temporary variable .
 def swap ( a , b ) :
	a = ( a & b ) + ( a b )
	b = a + ( ~ b ) + 1
	a = a + ( ~ b ) + 1
	print ( " After ▁ Swapping : ▁ a ▁ = ▁ " , a , " , ▁ b ▁ = ▁ " , b )
a = 5
b = 10
swap ( a , b )