In this video, we will swap two bits of a given number using XOR and Bit Manipulation concepts in C/C++. Swapping is a useful application of XOR based bit manipulations. Swapping of Bits in a number is a very important utility, and using XOR the swap can be done without the use of branching ( i.e. If else statements ). This problem also helps us solidify the understanding of an important property of XOR operation.
This is a frequently asked interview question for software/firmware/embedded roles.
Must know concepts of XOR : • Must know concepts of XOR - Bit Mani...
Bit Manipulation basic techniques : • Bit Manipulation - Three most used fu...
See Bit Manipulation Interview Preparation Series here:
• Bit Manipulation Interview Series
#BitManipulation #XOR #BitAlgorithm
You may follow us on Facebook and Instagram:
Facebook : / firmwarecode
Instagram : / firmwarecode