Number of n digit numbers that do not contain 9 | Java 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 Code
import java . io . * ; public class GFG { static int totalNumber ( int n ) { return 8 * ( int ) Math . pow ( 9 , n - 1 ) ; } static public void main ( String [ ] args ) { int n = 3 ; System . out . println ( totalNumber ( n ) ) ; } }