employer cover photo
employer logo
employer logo

MindQuad Solutions

Is this your company?

MindQuad Solutions Interview Question

swipe two variable without using third variable

Interview Answers

Anonymous

Aug 29, 2023

a=int(input(“Enter value : “)) b=int(input(“Enter value : “)) print(“Before swapping a :”,a) print(“Before swapping b :”,b) #logic to swap without using third variable a=a+b b=a-b a=a-b print(“After swapping :”,a) print(“After swapping :”,b)

Anonymous

Aug 29, 2023

a=int(input(“Enter value : “)) b=int(input(“Enter value : “)) print(“Before swapping a :”,a) print(“Before swapping b :”,b) #logic to swap without using third variable a=a+b b=a-b a=a-b print(“After swapping :”,a) print(“After swapping :”,b)