Highest power of two that divides a given number | javascript program to find highest power of 2 that divides n . ; Driver code
function highestPowerOf2 ( n ) { return ( n & ( ~ ( n - 1 ) ) ) ; } var n = 48 ; document . write ( highestPowerOf2 ( n ) ) ;