Question d’entretien chez Yahoo

How do you switch values of variables A and B without using a third variable for storage?

Réponse à la question d'entretien

Utilisateur anonyme

14 juil. 2013

b = a + b a = b - a b = b - a If we have a = 3 and b = 5 we have: b = 3 + 5 = 8 a = b - a = 8 - 3 = 5 b = b - a = 8 - 5 = 3

1