Count of N | Java implementation of the approach ; Function to return the count of N - digit palindrome numbers ; Driver code
class GFG { static int nDigitPalindromes ( int n ) { return ( 9 * ( int ) Math . pow ( 10 , ( n - 1 ) / 2 ) ) ; } public static void main ( String [ ] args ) { int n = 2 ; System . out . println ( nDigitPalindromes ( n ) ) ; } }