Question d’entretien chez MindQuad Solutions

swipe two variable without using third variable

Réponses aux questions d'entretien

Utilisateur anonyme

29 août 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)

Utilisateur anonyme

29 août 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)