I\'m having a hard time understanding why
#include using namespace std; int fib(int x) { if (x == 1) { return 1; } else {
if(n==1 || n==0){ return n; }else{ return fib(n-1) + fib(n-2); }
However, using recursion to get fibonacci number is bad practice, because function is called about 8.5 times than received number. E.g. to get fibonacci number of 30 (1346269) - function is called 7049122 times!