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 : [ Ссылка ]
Bit Manipulation basic techniques : [ Ссылка ]
See Bit Manipulation Interview Preparation Series here:
[ Ссылка ]
#BitManipulation #XOR #BitAlgorithm
You may follow us on Facebook and Instagram:
Facebook : [ Ссылка ]
Instagram : [ Ссылка ]
Ещё видео!