Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Tagged as

Go to top

Fibonacci Recursive and Non Recursive C++

, 14 Sep 2010
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 | Mobile
Web03 | 2.8.140916.1 | Last Updated 14 Sep 2010
Article Copyright 2010 by ostream
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid