#include <stdio.h>
int isKthBitSet(int n, int k) {
// Write your code here
return (n & (0x01 << k)) != 0;
}
int main() {
int n, k;
scanf("%d %d", &n, &k);
printf("%d", isKthBitSet(n, k));
return 0;
}
Solving Approach
checking the requirements here check the Kth Set bit
inside the isKthBitSet function just return num Bitwise AND with the mask (0x01 << k) not equals to 0.