Kuwarsaab / git-learn

Hactoberfest-2024
MIT License
6 stars 55 forks source link

Create XorSwap.cpp #90

Closed Broxzier closed 1 month ago

Broxzier commented 1 month ago

Example output is:

Enter two values between 0-255.
Value a: 85
Value b: 15
Original values: a = 01010101, b = 00001111
After a = a ^ b: a = 01011010, b = 00001111
After b = a ^ b: a = 01011010, b = 01010101
After a = a ^ b: a = 00001111, b = 01010101

Now a is: 15 (00001111)
And b is: 85 (01010101)