fork download
  1. #include <stdio.h>
  2.  
  3. int fibo(int n, int a, int b){
  4. return (n>0) ? fibo(n-1, b, a+b) : 0;
  5. }
  6.  
  7. int main(){
  8. printf("5th term of fibo is %d", fibo(5, 0, 1));
  9. return 0;
  10. }
Success #stdin #stdout 0s 4596KB
stdin
Standard input is empty
stdout
5th term of fibo is 0