This is bad. Recursive fibonacci calls twice the same function with same parameters, like:Originally Posted by jazzistoobad
But of course this is only for learning purposes. And something this simple you'd never burst a stack. But you get the pointCode:int fib(int n){ if(n<=0) return 0; else if(n==1) return 1; return fib(n-1)+fib(n-2); }