Conditional Statements

  • + 0 comments
    #include <bits/stdc++.h>
    
    using namespace std;
    
    
    int main()
    {
        int n;
        cin>> n;
        string WordList[] = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
        
        if(n<=9 && n>=1)
            cout << WordList[n-1];
        else if(n>9)
            cout << "Greater than 9";
        
    
        return 0;
    }