Skip to content

Instantly share code, notes, and snippets.

@tuanpmt
Created May 2, 2022 11:31
Show Gist options
  • Save tuanpmt/9bd292ee6ac8b2b9526e8515fe62d590 to your computer and use it in GitHub Desktop.
Save tuanpmt/9bd292ee6ac8b2b9526e8515fe62d590 to your computer and use it in GitHub Desktop.
fib
int fib(int n)
{
if (n < 2) return n;
else {
int x = fib(n - 1);
int y = fib(n - 2);
return x + y;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment