Click here to Skip to main content
12,500,761 members (46,649 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

2.7K views
2 bookmarked
Posted

Fibonacci Recursive and Non Recursive C++

, 14 Sep 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
A stupid change :) int FibonacciR::Fibonacci(const int &n){ if(n<=1) return n; return Fibonacci(n-1) + Fibonacci(n-2); } :laugh:
A stupid change :)
int FibonacciR::Fibonacci(const int &n){
if(n<=1)
    return n;
return Fibonacci(n-1) + Fibonacci(n-2);
}
:laugh:

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

ostream
Afghanistan Afghanistan
No Biography provided

You may also be interested in...

Pro
Pro

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160919.1 | Last Updated 14 Sep 2010
Article Copyright 2010 by ostream
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid