Count of numbers in range [ L , R ] with LSB as 0 in their Binary representation | Function to return the count of required numbers ; Count of numbers in range which are divisible by 2 ; Driver code
function countNumbers ( l , r ) { return ( parseInt ( r / 2 ) - parseInt ( ( l - 1 ) / 2 ) ) ; } let l = 10 , r = 20 ; document . write ( countNumbers ( l , r ) ) ;