I have written a program to count the number of even and odd numbers entered from a list; but currently it wont work correctly, think its my modulus operators in the wrong place, but not 100%. Pretty knew to this.
/* Program to count the no of even and odd numbers*/
void main( )
int a, n, count_odd=0, count_evn=0,I;
printf("Enter numbers in array");
printf("Enter the integars, seperated by a space");
for (I=0;I < n;I++);
for(I=0;I < n;I++)
if(a[I] % 2 == 0)
printf("There are %d negative numbers in the arrayn\n",count_odd);
printf("There are %d positive numbers in the arrayn",count_evn);
Any suggestions would be appreciated. Thanks.