Question d’entretien chez Red Hat

How to swap two numbers without using temporary variable?

Réponses aux questions d'entretien

Utilisateur anonyme

17 avr. 2021

Swap(a, b){ a = a+b., b = a-b a = a-b } That works fine for numbers and characters only for complex types that will not work.

1

Utilisateur anonyme

18 avr. 2017

Provided addition/subtraction and XOR solution. But they were still looking for something else.

1