Take the binary complement of the number (~). Take two copies, and shift one
a bit (<<). Then AND (&, just one). If the answer is non-zero, you have
consecutive zero bits.
Thanks for your answer. but the solution you suggested only tells true
or false, whether consecutive zero bits are there or not.
i need something different :
i want to know how many consecutive zero bits are there?
for exapmle :
let say arr[0] = 10; so bit representation will be (32-bit)
00000000 00000000 00000000 00001010
so answer should be => 29 from MSB and 1 from LSB.
please clarify.