Advertisement
UMME_RUKAYA13

lab3

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