Count of all N digit numbers such that num + Rev ( num ) = 10 ^ N | C ++ implementation of the approach ; Function to return the count of such numbers ; If n is odd ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int countNumbers ( int n ) { if ( n % 2 == 1 ) return 0 ; return ( 9 * pow ( 10 , n / 2 - 1 ) ) ; } int main ( ) { int n = 2 ; cout << countNumbers ( n ) ; return 0 ; }