Check out example codes for "how to print nth palindrome number in c++". It will help you in understanding the concepts better.

Code Example 1

if(n <=1000 && i==0){
               // cout << " here "<<endl;
                count =0;
                i=0;
               // break;
                
            }else if( n >1000 && n <=2000 && i==0){
                //cout << "there " <<endl;
                count =1000;
                i=90109;
               // break;
            }else if( n >2000 && n <=2500 && i==0){
                //cout << "there " <<endl;
                count =2000;
                i=1001001;
                // break;
            }else if( n >2500 && n <=3000 && i==0){
                //cout << "there " <<endl;
                count =2500;
                i=1501051;
                // break;

Code Example 2

int n;
    int count =0;
    while(true){
        cin>> n;
        if (n == 0) return 0;
        
        if( n <= 10000){
        for( int i=1 ; i <= 2000000000; i++){

                if( palindrom(i) == true) {
                    count++;
                    //cout << "palindrom : " << i<< " count : " << count <<endl;
                
                
                    if( count == n ) {
                    
                        cout << i <<endl;
                   
                        count =0;
                        break;
                    }

Learn ReactJs, React Native from akashmittal.com