Conditional Statements in C

  • + 2 comments

    include

    int main() { int x = 0;

    char arr[10][9] = {
        "zero", "one", "two", "three", "four",
        "five", "six", "seven", "eight", "nine"
    };
    
    
    
    scanf("%d", &x);
    
    
    
    if (x >= 0 && x <= 9) 
    {
        printf("%s\n", arr[x]);
    } else {
        printf("Greater than 9 \n");
    }
    
    return 0;
    

    }