Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. int fibo(int n){
  2. if(n<1) return 0;
  3. if(n==1) return 1;
  4. if(n==2) return 1;
  5. return fibo(n-1)+fibo(n-2);
  6. }
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. int result = fibo(11);
  12. std::cout <<"Result:"<< result << std::endl;
  13.  
  14. return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement