Sort by

recency

|

1663 Discussions

|

  • + 0 comments

    // remove the other remain heade file these are the only one which needed

    include

    include

    using namespace std;

    int main() {

        //taking input
    int a, b;
    cin >> a >> b;
    
        // creating a array of lowercase letter
    string numString[] = {"one","two", "three", "four", "five", "six", "seven", "eight", "nine"};
    
        // creating a for loop and initialize it with a & b
    for(int i = a; i <= b; i++) {
                // checking if it's greater than 1 & smaller than 9
        if(i >= 1 && i <= 9) {
                    // if yes printing the letter
            cout << numString[i - 1] << endl;
        } else {
                        // if, > 9 then checking it's odd or even
            cout << (i % 2 == 0 ? "even" : "odd") << endl;
        }
    }
    
    return 0;
    

    } `

  • + 0 comments
    #include <iostream>
    #include <string>
    #include <cstdio>
    using namespace std;
    
    int main() {
        int n1, n2;
        cin >> n1 >> n2;
        string numStr[] = {"one","two","three","four","five","six","seven","eight","nine"};
        
        for (; n1 <= n2; n1++) {
            if (n1 <= 9) {
                cout << numStr[n1-1] << endl;
            }
            if (n1 > 9) {
                if (n1 % 2 == 0) {
                    cout << "even" << endl;
                } else {
                    cout << "odd" << endl;
                } 
            }
        }
        return 0;
    }
    
  • + 0 comments
    #include<bits/stdc++.h>
    using namespace std;
    
    int main()
    {
        long long n=0, n1=0;
        cin>>n;
        cin>>n1;
        string number[]={"one","two","three","four","five","six","seven","eight","nine"};
        for (int i=n;i<=n1;i++)
        {
        if (i<=9){cout<<number[i-1]<<endl;} 
          else if ((i%2)==1) cout<<"odd"<<endl; 
            else cout<<"even"<<endl;
        }
    }
    
  • + 0 comments
    void numberspell (int n ,int m) {
    
    string spell[]= {"one","two", "three", "four","five","six","seven","eight","nine"} ;
    
    for (;n<=m ;n++) {
        if (n>= 0 && n <=9)
          cout << spell[n-1] << endl; 
       if (n>9) {
          if (n%2) cout << "odd"<< endl;
          else cout << "even"<< endl ;
       }
    }
    

    }

  • + 0 comments
    #include <iostream>
    #include <cstdio>
    using namespace std;
        
    #define Low_Threshold   1
    #define High_Threshold  9
        
    string namingdb[11] = {"one","two","three","four","five","six","seven","eight","nine","even","odd"};
        
    int main() {
        int a,b;
    
        cin>>a>>b;
        for (int i=a; i<=b;i++)
        {
            if (i>=Low_Threshold && i<=High_Threshold)  
                                       cout<<namingdb[i-Low_Threshold]<<endl;
            else if (i>High_Threshold)
                                       cout<<namingdb[(High_Threshold+(i%2))]<<endl;
            else                        /*Do Nothing*/;
        }
        return 0;
    }