Given a number N. You have to check whether every bit in the binary representation of the given number is set or not.
N = 7Output:
Binary for 7 is 111 all the
bits are set so output is 1
N = 8Output:
Binary for 8 is 1000 all the
bits are not set so output is 0.
You don't need to read input or print anything. Your task is to complete the function isBitSet() which takes an integer N as input parameters and returns 1 if all the bits in N's binary representation is set or return 0 otherwise.
Expected Time Complexity: O(1) Expected Space Complexity: O(1)