Given a number x and two positions (from right side) in binary representation of x, write a function that swaps n bits at given two positions and returns the result. It is also given that the two sets of bits do not overlap.
Read full article from Swap bits in a given number | GeeksforGeeks
No comments:
Post a Comment