#include <stdio.h> #include <stdint.h> int isbitset(unsigned char reg , int pos){ return (reg & (1<<pos))? 1: 0; } int main(){ unsigned char reg; int pos; scanf("%hhu %d" ,® , &pos); printf("%d\n", isbitset(reg , pos)); return 0; }
Test Cases
Test Results
Input
4 2
Expected Output
1