Given an 8-bit register, check whether the bit at a specific position is set (i.e., equals 1).
Return 1 if the bit is set, otherwise return 0.
Example 1
Input: reg = 0b00000100, pos = 2 Output: 1
Example 2
Input: reg = 0b00000100, pos = 1 Output: 0
Test Cases
Test Results
Input
4 2
Expected Output
1