DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Fibonacci Function
This function returns the <i>n</i>th Fibonacci number, though most platforms can go no higher than the 47th.
int Fibonacci(int n) {
int a = 1, b = 1, c, i;
for (i=3; i<=n; i++) {c = b; b += a; a = c; }
return b;
}





