swap 2 numbers without using third variable?
Answers
Answered by
0
Answer:
#program that accepts that two numbers and swaps those two numbers
a=int(input("Enter the first number:"))
b=int(input("Enter the second number:"))
print("numbers before swaping:",a,b)
a=a+b
b=a-b
a=a-b
print("numbers after swaping:",a,b)
Similar questions
Chemistry,
6 months ago
Math,
6 months ago
Math,
6 months ago
Social Sciences,
1 year ago
English,
1 year ago