int count (int*a, int n, int x) { int i,result=0; for (i= 0; i< n; i++) if (a[i] == x) result++; return result; }