Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int fibo(int n){
- if(n<1) return 0;
- if(n==1) return 1;
- if(n==2) return 1;
- return fibo(n-1)+fibo(n-2);
- }
- using namespace std;
- int main()
- {
- int result = fibo(11);
- std::cout <<"Result:"<< result << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement