0
#include <stdio.h>
int main()
{
    int numArrays[] = {2, 67, 23, 5, 7, 34, 14, 4, 8, 62};
    int i;

    printf("Odd Numbers in numArray:\n");

    for(i=0;i<10; i++)
    {       
       if(numArray[i]%2==1)
       {
        printf("%d ",numArray[i]);
    total += i;
        sum=sum+total;
    sum=sum+1;
    printf("There are %d odd numbers\n", sum);
       }        
     }

    printf("even numbers in numArray;\n");
     for(i=0; i<10; i++)
        {
         if(numArray[i]%2==0)
            {
                printf("%d", numArray[a]);
        total += i;
            sum=sum+total;
        sum=sum+1;
        printf("There are %d odd numbers\n", sum);
         }
    }
}

whats the problem of this code? im just a biggener ...hehehe

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by Ancient Dragon
0

what does it do or what does it not do that you want it to do? We need a bit more information about that the problem is. I can tell you that you don't need line 29.

Please don't create new threads to ask additional questions about the same problem, just add another post to the thread you already created. Its less confusing for everyone.

Edited by Ancient Dragon

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.