Kth LSB
Submissions: 929   Accuracy:

22.03%

  Difficulty: Easy   Marks: 2

A number N is given. We need to print its ‘K’th Least Significant Bit.

Input : num = 10, k = 4 
Output : 1
Explanation : Binary Representation 
of 10 is 1010. 4th LSB is 1.

Input:
First line consists of T test cases. Single line input, two integers N and K.

Output:
Single line output, print the required output.

Constraints:
1<=T<=100
1<=N<=10^9

Example:
Input:

2
10 4
16 3
Output:
1
0

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Raj Seth
Author: saksham seth


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.