Can anybody help me to solve this problem?
My program doesn't work as what it is required. Here is the question and my program code.
Thanks.
/**Twenty-five numbers are entered from the keyboard into an array.
Write a program to find out how many of them are positive,
how many are negative, how many are even and how many odd. **/
#include<stdio.h>
int main()
{
int num[5];
int i;
printf("Enter 5 int numbers ");
for (i=0;i<=4;i++){
scanf("%d",&num[i]);
}
for(i=0;i<=4;i++){
if(num[i]%2==0){
printf("\nEven number : %d",num[i]);
}
else if(num[i]<0){
printf("\nNegative number : %d",num[i]);
}
else if(num[i]%2!=0){
printf("\nOdd number : %d",num[i]);
}
else if(num[i]>=0){
printf("\nPositive number : %d",num[i]);
}
}
return 0;
}