Explanation about the question :--

xxx...xxxa....aax..xx and

yyyyyyyy....ynnnn..n

_____________________ and the result will be

xxx...xxxn....nnx..xx

for eg:

if x = 101

**101**01

and y = 10111

**010**

and we want to find setbits(x,4,3,y)

then we want to replace x = 101

*01 the underlined bits to the last three bits of y.*

__101__ie the result must be x = 101

**01**

*010*