Question:
We need to swap the two numbers without using third variable.
For Example:
A=6, B=7
def swap(num1,num2):
num1 = num1+num2
num2 = num1-num2
num1 = num1-num2
print(num1, num2)
Swap(6, 7)
---------End---------
Top MNC interview question which will be very useful for beginners to crack the interview and for there future careers
Question:
We need to swap the two numbers without using third variable.
For Example:
A=6, B=7
def swap(num1,num2):
num1 = num1+num2
num2 = num1-num2
num1 = num1-num2
print(num1, num2)
Swap(6, 7)
---------End---------
About Programming Blog
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis.
Read More