Count Numbers with N digits which consists of odd number of 0 's | Java program to count numbers with N digits which consists of odd number of 0 's ; Function to count Numbers with N digits which consists of odd number of 0 's ; Driver code
import java . io . * ; class GFG { static int countNumbers ( int N ) { return ( int ) ( Math . pow ( 10 , N ) - Math . pow ( 8 , N ) ) / 2 ; } public static void main ( String [ ] args ) { int n = 5 ; System . out . println ( countNumbers ( n ) ) ; } }