...

/

Check If Kth Bit Is Set/Unset

Check If Kth Bit Is Set/Unset

In this lesson, we try to find a bit in the binary representation of a number at the kth position and check if it is set/un-set. We have already done this, but here we will go over it with the right shift.

Introduction

In this question, input a number and check if the kthk^{th} bit is set or not.

Problem statement

Given two positive integers n and k check ...

Access this course and 1400+ top-rated courses and projects.