• + 2 comments
    //Compares the values of a, b with 9 and if values <= 9 then
    //Prints all values from 'a' uptill 'b' in string format
    if ((a<=9)&&(b<=9)){ 
           for(n=a;n<=b;n++){
                cout << intMap[n-1]<<endl; 
            } }
        //Compares the values of a, b with 9
        //And if the value of a <= 9 and value of b > 9 then....
        else if ((a<=9)&&(b>9)){    
            //Prints all the values starting from 'a' uptill 9
            //in string format and then....
            for(n=a;n<=9;n++){
                cout<<intMap[n-1]<<endl;
            }
            //For values which are greater than 9 and <= to 'b'
            //Prints 'even' or 'odd' for them
            for(n=10;n<=b;n++){    
                if (n%2==0){
                    cout<<"even"<<endl;
                }
                 else {
                     cout<<"odd"<<endl;
                 }
             }
      }
    
    Hope that helps.