We're a place where coders share, stay up-to-date and grow their careers.
you could do something like this, to prevent errors when calling fibo:
int fibonacci(int n) { int go(int i, int a, int b) { if (n == 0) return a; if (n == 1) return b; return go(n - 1, b, a + b); } return go(n, 0, 1); }
you could do something like this, to prevent errors when calling fibo: