OK... a few things....
1) Learn to indent your code and leave a blank line or 2 between code sections to make it more readable ....
Code:
int countEvent(int *ptr, int size)
{
int i, even_cnt = 0;
for(i = 0; i<=size; i++)
{
if(*(ptr+1)%2 == 0)
even_cnt++;
}
return even_cnt;
}
2) You are not moving your pointer along the array *(ptr+1) always points to the same element, perhaps you wanted *(ptr + i) in that spot.
3) You are overrunning your array's bounds... in C arrays start at 0 and go to size-1, thus an array of 10 elements has valid indexes of 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 .... so your loops have to stop one short of the size... for (1 = 0; i < size; i++)
4) Although you may not have learned about bitwise operations yet, a much easier way of checking for odd/even integers is to and (&) it with 1 as in y = x & 1; For even numbers y = 0, for odd numbers y = 1.
5) When calling your function from main you do not need the & (address of) operator infront of the array name.
6) The correct form of main() is int main (void).