Skip to content
C

Read the K-th Bit

Mediumjava

Read a non-negative integer n and a bit position k (0 = least significant). Print the value of that bit using (n >> k) & 1.

Input: two integers n and k separated by whitespace.

Output: one line — 0 or 1.

Input (stdin)

Output

Run your code to see output here...