Interview Questions and Answers :: Cavium Networks
Home > Experience Archives > Cavium Networks > Interview Question Set 3 > Discussion
2. Swap the Bit's from x location to y location.
Answer:
USE XOR OPERATION FOR THIS
X=X^Y
Y=Y^X
X=X^Y
By using these three conditions we can exchange of X and Y bits.
Deepu
2 Feb, 2018 12:26 PM
USE XOR OPERATION FOR THIS
X=X^Y
Y=Y^X
X=X^Y
By using these three conditions we can exchange of X and Y bits.
Report Error
Report Error
Please Login First Click Here