[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CppFibonacci
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CppFibonacci
(C++) Fibonacci
Using recursion:
int fibonacci(const int n)
{
if (1==n || 2==n)
{
return 1;
}
else
{
return fibonacci(n-2) + fibonacci(n-1);
}
}
Code links
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
