sir i didnt think why but im not able to visualize it clearly
that we need β0β at jth index so why we are doing ~0<<(j+1) instead of ~0<<j;
Thanks
Doubt in bit manipulation in clear range-of-bits
@Royal_Yashasvi
the explaination of ~0<<i.
(added β_β to indent it well)
~0 = ___11111111
~0<<1 = 11111110 //zero at zeroth bit
~0<<2 = 11111100 // zero uptill first bit
~0<<3 = 11111000 // zero uptill second bit
so
~0<<(j+1) is zero upltill jβth bit.
Can you please tell me what exactly you want to do? and yeah indexing are zero-based.