title: C Recursive Function for prime number with just one parameter
body: <p>Im trying to make a function to check if a number is prime number or not, using recursion. The best two examples are these two programs (one without recursion, one using recursion).</p>
  
  <p><strong>Using recursion:</strong></p>
  
  <pre><code>    #include&lt;stdio.h&gt;
  
  int isPrime(int,int);
  
  int main(){
  
      int num,prime;
  
      printf("Enter a positive number: ");
      scanf("%d",&amp;num);
  
      prime = isPrime(num,num/2);
  
     if(prime==1)
          printf("%d is a prime number",num);
     else
        printf("%d is not a prime number",num);
  
     return 0;
  }
  
  int isPrime(int num,int i){
  
      if(i==1){
          return 1;
      }else{
         if(num%i==0)
           return 0;
         else
           isPrime(num,i-1);
      }
  }
  </code></pre>
  
  <p><strong>Without using recursion:</strong></p>
  
  <pre><code>     #include&lt;stdio.h&gt;
  
  int isPrime(int);
  
  int main(){
  
      int num,prime;
  
      printf("Enter a positive number: ");
      scanf("%d",&amp;num);
  
      prime = isPrime(num);
  
     if(prime==1)
          printf("%d is a prime number",num);
     else
        printf("%d is not a prime number",num);
  
     return 0;
  }
  
  int isPrime(int num){
  
      int i=2;
  
      while(i&lt;=num/2){
           if(num%i==0)
               return 0;
           else
               i++;
      }
  
      return 1;
  }
  </code></pre>
  
  <p>My question is: Is it possible to make a function to check if a number is prime number or not, using recursion, but with just one parameter (like this: int isPrime(int num))?</p>
  
  <p>Any help is appreciated</p>