Question d’entretien chez Qualcomm

Swap two numbers without using a temporary variable

Réponses aux questions d'entretien

Utilisateur anonyme

26 janv. 2010

x = 10 y = 5 x = x+y // x = 15, y =5 y = x-y // x = 15 , y = 10 x = x-y // x = 15 - 10 = 5 , y = 10 another way, x = x^y y = x^y x = x^y

6

Utilisateur anonyme

28 juin 2016

Shift register.

1

Utilisateur anonyme

5 nov. 2017

a = a ^ b; b = a ^ b; a = a ^ b;