title: Finding number of prime numbers in an array
body: <p>I'm trying to write a function that finds the number of prime numbers in an array.</p>
  
  <pre><code>int countPrimes(int a[], int size)
  {
      int numberPrime = 0;
      int i = 0;
      for (int j = 2; j &lt; a[i]; j++)
      {
          if(a[i] % j == 0)
              numbPrime++;
      }
      return numPrime;
  }
  </code></pre>
  
  <p>I think what I'm missing is I have to redefine i after every iteration, but I'm not sure how. </p>