title: Fibonacci using Recursion
body: <p>This is my idea of solving 'nth term of fibonacci series with least processing power'-</p>
  
  <pre><code>int fibo(int n, int a, int b){
      return (n&gt;0) ? fibo(n-1, b, a+b) : a;
  }
  
  main(){
      printf("5th term of fibo is %d", fibo(5 - 1, 0, 1));
  }
  </code></pre>
  
  <p>To print all the terms, till nth term,</p>
  
  <pre><code>int fibo(int n, int a, int b){
      printf("%d ", a);
      return (n&gt;0)? fibo(n-1, b, a+b): a;
  }
  </code></pre>
  
  <p>I showed this code to my university professor and as per her, this is a wrong approach to solve Fibonacci problem as this does not abstract the method. I should have the function to be called as fibo(n) and not fibo(n, 0, 1). This wasn't a satisfactory answer to me, so I thought of asking experts on SOF.</p>
  
  <p>It has its own advantage over traditional methods of solving Fibonacci problems. The technique where we employ two parallel recursions to get nth term of Fibonacci (fibo(n-1) + fibo(n-2)) might be slow to give 100th term of the series whereas my technique will be lot faster even in the worst scenario.</p>
  
  <p>To abstract it, I can use default parameters but it isn't the case with C. Although I can use something like -</p>
  
  <pre><code>int fibo(int n){return fiboN(n - 1, 0, 1);}
  int fiboN(int n, int a, int b){return (n&gt;0)? fiboN(n-1, b, a+b) : a;}
  </code></pre>
  
  <p>But will it be enough to abstract the whole idea? How should I convince others that the approach isn't wrong (although bit vague)? </p>
  
  <p>(I know, this isn't sort of question that I should I ask on SOF but I just wanted to get advice from experts here.)</p>