An Interest In:
Web News this Week
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
June 19, 2022 03:34 pm GMT
Original Link: https://dev.to/hebashakeel/check-if-the-kth-bit-it-set-2il3
Check if the Kth bit it set!
Example 1:
n= 5
k = 1
binary representation of 5 : 101
1st bit from right is set
therefore output = YES
Example 2:
n = 8
k = 2
binary representation of 8 : 1000
2nd bit from right is not set
therefore output = NO
Original Link: https://dev.to/hebashakeel/check-if-the-kth-bit-it-set-2il3
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To