Pregunta de entrevista de BNP Paribas

Swap 2 numbers without using temp variable. Why Testing.

Respuesta de la entrevista

Anónimo

20 de oct de 2018

Let i=20, j=5 If (i>j) { i=i+j so now it is 25 j=i-j so now 20 i=i-j so now 5 Else reverse the variables

9