Quantcast
Viewing latest article 40
Browse Latest Browse All 42

Answer by Ja͢ck for Swapping two numbers using only two variables

The swap is performed using XOR, which is typically written as a plus within a circle (⊕); for example:

a := 5b := 7a := a xor b (2)b := a xor b (5)a := b xor a (7)

Viewing latest article 40
Browse Latest Browse All 42

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>