title: program doesn't stop and continues to run
body: <p>This program is supposed to return nth prime using two functions, <code>nthPrime(n)</code> and <code>isPrime(candidatePrime, Vector&lt;int &gt;&amp;primes)</code>. We store the checked numbers that are prime in a vector and then divide the successive candidate by elements from the vector. But my program doesn't stop and no output is shown. </p>
  
  <p>The code is : </p>
  
  <p><img src="https://i.stack.imgur.com/xIgk8.png]" alt="isPrime(int candidatePrime,Vector&lt;int &gt;&amp;primes"></p>