Check if a number has two adjacent set bits | Javascript program to check if there are two adjacent set bits . ; driver program
function adjacentSet ( n ) { let x = ( n & ( n >> 1 ) ) ; if ( x > 0 ) return true ; else return false ; } let n = 3 ; if ( adjacentSet ( n ) ) document . write ( " " ) ; else document . write ( " " ) ;