Count of all N digit numbers such that num + Rev ( num ) = 10 ^ N | Java implementation of the approach ; Function to return the count of such numbers ; If n is odd ; Driver code
class GFG { static int countNumbers ( int n ) { if ( n % 2 == 1 ) return 0 ; return ( 9 * ( int ) Math . pow ( 10 , n / 2 - 1 ) ) ; } public static void main ( String args [ ] ) { int n = 2 ; System . out . print ( countNumbers ( n ) ) ; } }