Advertisement
rafikamal

Fibonacchi

Jan 28th, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.22 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int fibonacchi(int n);
  4.  
  5. int main()
  6. {
  7.     printf("%d\n", fibonacchi(7));
  8.    
  9.     return 0;
  10. }
  11.  
  12. int fibonacchi(int n)
  13. {
  14.     if(n <= 2)
  15.         return 1;
  16.     else
  17.         return fibonacchi(n - 1) + fibonacchi(n - 2);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement