#include<stdio.h>
unsigned char nibble(unsigned char reg , int choice)
{
if(choice ==0){ //is choice 0 by user then its nee bit
return reg & 0x0F;//lower (0-4)
}
else{
return (reg>>4) & 0x0F;
}
}
int main()
{
unsigned char reg;
int ch;
//printf("enter reg and choice");
scanf("%hhu %d" ,® ,&ch);
printf("%d", nibble(reg,ch));
return 0;
}