Trivial C, C++ Programs.

Tag Archives: Fibonacci Series

Fibonacci Series (Using Recursion) in C++

This is a simple 2 statement function that takes n as an argument and returns the nth Fibonacci number. Can be used to display the Fibonacci series upto the integer size limit.   #include <iostream.h> #include <conio.h>   unsigned int fibonacci (unsigned int n) { if (n <= 2) { return 1; } else { [...]