All submissions

Code

#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" ,&reg , &pos);
    printf("%d\n", isbitset(reg , pos));
    return 0;
}

Solving Approach

 

 

 

Loading...

Input

4 2

Expected Output

1