title: Printing prime numbers in Java using recursion
body: <p>I wrote a similar function in C, and was able to achieve the required result unlike java.
  Below is the code, which checks if a number is prime recursively. 
  Compilation says, i'm missing a return statement.
  The number to be checked if a prime is x. The variable i is the divisor.(ie) x/2, (x/2)-1,...0.</p>
  
  <pre><code>public int primes(int x, int i)
  {
      if(i==0)
          return 1;
      if(x%i==0)
          return 0;
      else
          primes(x, i-1);
  }
  </code></pre>
  
  <p>What is the complexity of this code if I had to print the first 1000 prime numbers.</p>