Number of n digit numbers that do not contain 9 | CPP program to find number of n digit numbers that do not contain 9 as it 's digit ; function to find number of n digit numbers possible ; driver function
#include <bits/stdc++.h> NEW_LINE using namespace std ; int totalNumber ( int n ) { return 8 * pow ( 9 , n - 1 ) ; } int main ( ) { int n = 3 ; cout << totalNumber ( n ) ; return 0 ; }