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
< ? php function countNumbers ( $ N ) { return ( pow ( 10 , $ N ) - 1 ) - ( pow ( 10 , $ N ) - pow ( 8 , $ N ) ) / 2 ; } $ n = 2 ; echo countNumbers ( $ n ) , " STRNEWLINE " ; ? >