What you need is the array, size of the array and the value to be searched. Just run the loop from zero to end and count if numer exists....
Sample function
int count_occur(int a[], char exists[], int num_elements, int value)
{
int i, count = 0;
for (i = 0; i < num_elements; i++)
{
if (a[i] == value)
{
if (exists[i] != 0) return 0;
++count; /* it was found */
}
}
return (count);
}