#include <stdio.h> #include <stdint.h> int main() { uint16_t reg; scanf("%i", ®); // auto-detect hex/decimal uint16_t field = (reg >> 4) & 0x1F; printf("%u", field); return 0; }
Test Cases
Test Results
Input
0x01F0
Expected Output
31