Click here to Skip to main content
11,415,973 members (83,486 online)
Click here to Skip to main content
Alternative Tip/Trick

Tagged as

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 Smile | :)
    int FibonacciR::Fibonacci(const int &n){
   	if(n<=1)
   		return n;
  	return Fibonacci(n-1) + Fibonacci(n-2);
    }
Laugh | :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

Comments and Discussions

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