Answers for "get ith bit"

0

get ith bit

(x&(1<<i) != 0)

    0010 1100
&   0010 0000   (1<<i)
  ------------
    0010 0000   (is not zero)
Posted by: Guest on April-20-2021

Browse Popular Code Answers by Language