Skip to content

Instantly share code, notes, and snippets.

@gallib
Created January 26, 2021 16:58
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 gallib/02f31fd8dc0f9fde9ed94f3107d6711b to your computer and use it in GitHub Desktop.
Save gallib/02f31fd8dc0f9fde9ed94f3107d6711b to your computer and use it in GitHub Desktop.
Débuter avec Dart, exercice 7
void main() {
var number = 20;
print('fibonacci($number) = ${fibonacci(number)}');
}
int fibonacci(int number) {
return number < 2 ? number : (fibonacci(number - 1) + fibonacci(number - 2));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment