Count all possible N digit numbers that satisfy the given condition | Java implementation of above approach ; Function to return the count of required numbers ; If N is odd then return 0 ; Driver Code
class GFG { static String getCount ( int N ) { if ( N % 2 == 1 ) return "0" ; String result = "9" ; for ( int i = 1 ; i <= N / 2 - 1 ; i ++ ) result += "0" ; return result ; } public static void main ( String [ ] args ) { int N = 4 ; System . out . println ( getCount ( N ) ) ; } }