Question d’entretien chez Bank of America

Swap two numbers while not using the temp variable.

Réponses aux questions d'entretien

Utilisateur anonyme

27 sept. 2013

a = a+b; b = a -b; a= a- b;

7

Utilisateur anonyme

10 mars 2013

using the XOR operator

3

Utilisateur anonyme

4 févr. 2015

a = a ^ b b = a ^ b a = a ^ b This will avoid over flows which might come in addition steps