Sollicitatievraag bij Intel Corporation

How can you exchange the value of two variables without using a third variable?

Antwoorden op sollicitatievragen

Anoniem

22 mrt 2011

x = x + y y = x - y x = x - y

9

Anoniem

6 apr 2015

int Val1 = 5; int Val2 = 10; Val1 ^= Val2; Val2 ^= Val1; Val1 ^= Val2;