Pregunta de entrevista de Red Hat

How to swap two numbers without using temporary variable?

Respuestas de entrevistas

Anónimo

17 abr 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

Anónimo

18 abr 2017

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

1