it gives me "id returned 1 exit status" and wont run. why?
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int isEven(int*);
int main(void)
{
static int numbers[5];
int catcher, i;
for(i=0;i<5;i++)
{
scanf("%d",&numbers[i]);
}
catcher=isEven(numbers);
for(i=0;i<5;i++)
{
printf("%d",catcher);
}
getch();
return 0;
}
int isEven(int *num)
{
int isEvenResults[5], i;
int *ans=(int*)calloc(5, sizeof(int));
*ans=isEvenResults[0];
for(i=0;i<5;i++)
{
if(num[i]%2==0){
*(ans+i)=0;
}else{
*(ans+i)=1;
}
}
return *ans;
}
im trying to display 1 if the number is odd and 0 if even..
use code tags
move this to the beginner section