SyntaxFix
Write A Post
Hire A Developer
Questions
int fib(int n) { if (n == 1 || n == 2) { return 1; } else { return fib(n - 1) + fib(n - 2); } }
in fibonacci sequence first 2 numbers always sequels to 1 then every time the value became 1 or 2 it must return 1