Skip to content

Instantly share code, notes, and snippets.

@yakkomajuri
Created July 13, 2020 20:06
Show Gist options
  • Save yakkomajuri/2a565b4efdc502463d47cf73460d55d1 to your computer and use it in GitHub Desktop.
Save yakkomajuri/2a565b4efdc502463d47cf73460d55d1 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int fibonacci(int n) {
if (n <= 1) {
return n;
}
return fibonacci(n-1) + fibonacci(n-2);
}
int main(void) {
printf("%i", fibonacci(40));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment