Sort by

recency

|

839 Discussions

|

  • + 0 comments

    This challenge is a great way to practice using the for loop and conditional statements effectively. 11xplay Pro Login

  • + 0 comments
    int main() 
    {
        int a, b;
        scanf("%d\n%d", &a, &b);
      	// Complete the code.
        char *numbers[] = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
        for (int i = a; i <= b; i++) {
            if (i <= 9)
                printf("%s\n", numbers[i-1]);   
            else if (i > 9) {
                char *even_or_odd = (i % 2 == 0) ? "even" : "odd";
                printf("%s\n", even_or_odd);   
            }
        }
    }
    
  • + 0 comments

    include

    void digitnames(int n){ char *digitNames[] = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};

    if (n >= 0 && n <= 9)
    {
        printf("%s\n", digitNames[n]);
    
    }
    if (n>=10){
        printf("nine\n");
    }
    

    } void oddeven(int m){ int odd,even; if(m%2==0){ printf("even\n"); }else{printf("odd\n");} } int main() { int digitstore[2]; for (int i = 0; i < 2; i++) { scanf("%d", &digitstore[i]); }

    for (int i = 0; i < 2; i++) {
        digitnames(digitstore[i]);
    }
    
    for (int i = 0; i < 2; i++) {
    

    * oddeven(digitstore[i]); }

    return 0;
    

    }

  • + 0 comments

    include

    include

    include

    include

    int main() { int a,b,i; scanf("%d%d",&a,&b); char* mydata[]={"zero","one","two","three","four","five","six","seven","eight","nine"}; if(a>=0 && a<=9){ printf("%s\n",mydata[a]); } if(b>=0 && b<=9){ printf("%s\n",mydata[b]); } if(a%2==0){ printf("even\n"); }else{ printf("odd\n"); } if(b%2==0){ printf("even\n");

    }else{
        printf("odd");
    }
    
  • + 0 comments

    include

    include

    include

    include

    int main() { int a,b,i; scanf("%d%d",&a,&b); char* mydata[]={"zero","one","two","three","four","five","six","seven","eight","nine"}; if(a>=0 && a<=9){ printf("%s\n",mydata[a]); } if(b>=0 && b<=9){ printf("%s\n",mydata[b]); } if(a%2==0){ printf("even\n"); }else{ printf("odd\n"); } if(b%2==0){ printf("even\n");

    }else{
        printf("odd");
    }