Falak_Ahmed_Shakib

kth set bit or not function

Oct 7th, 2021 (edited)
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. bool isKthBitSet(int n, int k)
  2. {
  3. if (n & (1 << k))return true;
  4. else return false;
  5.  
  6. }
  7.  
  8.  
  9. long long 2^60
  10.  
  11.  
  12.  
  13. bool isKthBitSet(ll n, ll k)
  14. {
  15. if (n & (1ll << (k)))return true;
  16. else return false;
  17. }
  18.  
Add Comment
Please, Sign In to add comment