Hi,
I recently wrote a c program and as you may see i declared function before main but i did not enter any type (int) or parameter. why is it compiling?
Code:
#include <stdio.h>
void spec();
int main()
{
unsigned int i;
int numbers[100];
int even = 0, odd = 0;
spec();
}
void spec(int i, int numbers[], int even, int odd)
{
printf("%s", "Enter 100 numbers:\n");
for (i=0; i<100; i++)
{
scanf("%d", &numbers[i]);
if (numbers[i] % 2 == 0)
even++;
else
odd++;
printf("even is %d odd is %d\n", even, odd);
}
}
// [email protected]