Skip to content

Instantly share code, notes, and snippets.

@hoctructuyencntt
Last active July 26, 2022 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoctructuyencntt/ebe337f37692ea4e9ef252344f74a5b0 to your computer and use it in GitHub Desktop.
Save hoctructuyencntt/ebe337f37692ea4e9ef252344f74a5b0 to your computer and use it in GitHub Desktop.
#include<stdio.h>
int fib(int n)
{
if (n <= 1)
return n;
return fib(n-1) + fib(n-2);
}
int main ()
{
int n;
printf("Nhập n = ");
scanf("%d\n", &n);
printf("Kết quả: %d", fib(n));
getchar();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment