#include <stdio.h>
#include <stdint.h>
uint8_t is_bit_set(uint8_t reg, uint8_t pos)
{
// Create a mask with only the bit at 'pos' set to 1
uint8_t mask = (1 << pos);
// Perform a bitwise AND operation
// If the result is non-zero, the bit was set in reg
if ((reg & mask) != 0)
{
return 1;
}
else
{
return 0;
}
}
int main() {
uint8_t reg, pos;
scanf("%hhu %hhu", ®, &pos);
printf("%u", is_bit_set(reg, pos));
return 0;
}