Count Numbers with N digits which consists of even number of 0 ’ s | Function to count Numbers with N digits which consists of odd number of 0 's ; Driver code
function countNumbers ( N ) { return ( Math . pow ( 10 , N ) - 1 ) - ( Math . pow ( 10 , N ) - Math . pow ( 8 , N ) ) / 2 ; } var n = 2 ; document . write ( countNumbers ( n ) ) ;