Write a program to check the status of the bit set or not
Answers
Answered by
1
Explanation:
Method 1 (Using Left Shift Operator)
1) Left shift given number 1 by k-1 to create a number that has only set bit as k-th bit. temp = 1 << (k-1) 2) If bitwise AND of n and temp is non-zero, then result is SET else result is NOT SET.5 days ago
Hope it helps you
Similar questions