Conditional Statements in C

  • + 0 comments
    #include<stdio.h>
    
    int main()
    {
        int n;
        scanf("%d", &n);
        
        char word[10][10] = {"zero","one","two","three","four", "five","six","seven","eight","nine"};
        
        if(n>=1 && n<=9)
            printf("%s\n", word[n]);
        else
            printf("Greater than 9\n");
        
        return 0;
    }