Count ' d ' digit positive integers with 0 as a digit | C ++ program to find the count of positive integer of a given number of digits that contain atleast one zero ; Returns count of ' d ' digit integers have 0 as a digit ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int findCount ( int d ) { return 9 * ( pow ( 10 , d - 1 ) - pow ( 9 , d - 1 ) ) ; } int main ( ) { int d = 1 ; cout << findCount ( d ) << endl ; d = 2 ; cout << findCount ( d ) << endl ; d = 4 ; cout << findCount ( d ) << endl ; return 0 ; }