Domanda di colloquio di BNP Paribas

Swap 2 numbers without using temp variable. Why Testing.

Risposta di colloquio

Anonimo

20 ott 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