hebaShakeel Posted on Jun 19, 2022 Check if the Kth bit it set! #codenewbie #computerscience #programming 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 Solution using Left Shift operator: Solution using Right Shift Operator: Top comments (0) Subscribe Submit Preview Dismiss Code of Conduct • Report abuse
Top comments (0)