Bit manuipulation clear range of bits

I=1 and j=3 ke baad kyshe solve kiya pzz explain 1 by 1 step

N=00011111
i=1 and j=3
we want to create mask like 11110001
this mask can be created using or of two masks
1) 11110000
2) 00000001

to make 1) left shift all ones by j+1
11111111 (~0)
(~0)<<(j+1) ==> 11110000

to make 2) left shift all ones by i and then take negation
((~0)<<i) ==> 11111110
now take not of this
~(((~0)<<i)) ===> 00000001

now take or of two
[ (~0)<<(j+1) ] || [ ~(((~0)<<i)) ] ==> 11110001

in this way we created mask

if you want to ask something about this feel free to ask
i hope this helps
if yes show your response with :heart: and don’t forgot to mark doubt as resolved