wiley_pastebin

Fibonnaci

Apr 12th, 2019
2,503
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.18 KB | None | 0 0
  1. /* The Fibonacci Sequence*/
  2.  
  3. int fibonacci (int n)
  4. {
  5.     if(n == 0)
  6.     {
  7.     return 0;
  8.     } else if(n == 1)
  9.     {
  10.     return 1;
  11.  
  12.     }else
  13.     {
  14.     return fibonacci(n-1) + fibonacci(n-2);
  15.     }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment