Print ' K ' th least significant bit of a number | Function returns 1 if set , 0 if not ; Driver code ; Function call
function LSB ( num , K ) { let x = ( num & ( 1 << ( K - 1 ) ) ) != 0 ; return ( x ) ; } let num = 10 , K = 4 ; if ( LSB ( num , K ) ) document . write ( " " ) ; else document . write ( " " ) ;