Find value of k | Java program to find k - th bit from right ; Driver Code ; Function Call
import java . io . * ; class GFG { static void printKthBit ( long n , long k ) { System . out . println ( ( ( n & ( 1 << ( k - 1 ) ) ) >> ( k - 1 ) ) ) ; } public static void main ( String [ ] args ) { long n = 13 , k = 2 ; printKthBit ( n , k ) ; } }