GeeksforGeeks » Interview Questions
Microsoft Interview Question for Software Engineer/Developer about Bit Magic
(2 posts)-
two 32bit integers m,n are given.replace all the bits in m from i to j locations with all the bits in n from k to l locations....
eg. m = 110000000000 n = 10101010 i=3 j=5 k=5 l=7
o/p:110000101000 -
m = (((n>>5)&(2^(l-k+1) -1))<<i)||m
Reply
You must log in to post.