Associated Course(s):
Must Do Interview Preparation
Sudo Placement 2019

Given a number **N **and a bit number **K**, check if **K ^{th}** bit of N is

**Input:**

The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case consists of two lines. The first line of each test case contain an integer **N**. The second line of each test case contains an integer **K**.

**Output:**

Corresponding to each test case, print "**Yes**" (without quotes) if** K**^{th } bit is set else print "**No**" (without quotes) in a new line.

**Constraints:**

1 ≤ T ≤ 200

1 ≤ N ≤ 10^{9}

0 ≤ K ≤ floor(log_{2}(N) + 1)

**Example:
Input**:

3

4

0

4

2

500

3

**Output**:

No

Yes

No

**Explanation:
Testcase 1:** Binary representation of 4 is 100, in which 0

Author: gaurav miglani

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.

Akkki111 | 38 |

SaltBaeSama | 34 |

ambercyrus | 33 |

LegendFire | 32 |

chocozz | 32 |

KshatriyaYash | 1932 |

nikhil_sojan | 1374 |

lonecoder | 1219 |

mazumderrohit8 | 1095 |

SumitSingh27 | 1090 |

blackshadows | 5327 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4566 |

Quandray | 4444 |

Login to report an issue on this page.