title: Finding the Nth prime number in C language
body: <p>The code runs just fine but instead of using "for loop" to iterate upto 200000 , I think there can be a better alternative and I am having trouble finding it. I need help to optimise this solution.The time taken by this solution currently is 56ms.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  #include &lt;stdbool.h&gt;
  
  int isPrime(long long int number)
  {
      int i;
      for (i=2; i*i&lt;=number; i++) {
          if (number % i == 0) return 0;
      }
      return 1;
  }
  int returnNPrime(int N)
  {
      int counter = 0;
      int i ;
      if(N == 1) return 2;
      for(i=3;i&lt;200000;i+=2)
      {
          if(isPrime(i))
          {
              counter++;
              if(counter == (N-1))
               return i;
          }
      }
      return 0;
  }
     int main(int argc, char *argv[]) 
     {
         printf("%d",returnNPrime(10001));
         return 0;
     }
  </code></pre>