Count ' d ' digit positive integers with 0 as a digit | Returns count of ' d ' digit integers have 0 as a digit ; Driver Code
< ? php function findCount ( $ d ) { return 9 * ( pow ( 10 , $ d - 1 ) - pow ( 9 , $ d - 1 ) ) ; } { $ d = 1 ; echo findCount ( $ d ) , " STRNEWLINE " ; $ d = 2 ; echo findCount ( $ d ) , " STRNEWLINE " ; $ d = 4 ; echo findCount ( $ d ) , " STRNEWLINE " ; return 0 ; } ? >