Skip to content

Instantly share code, notes, and snippets.

@NoobSolver
Created March 6, 2020 17:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NoobSolver/bd18dec63e4e78811edea18f3099c7cb to your computer and use it in GitHub Desktop.
Save NoobSolver/bd18dec63e4e78811edea18f3099c7cb to your computer and use it in GitHub Desktop.
Fibonacci sequence
void main() {
var i = 20;
print('fibonacci($i) = ${fibonacci(i)}');
}
int fibonacci(int n) {
return n < 2 ? n : (fibonacci(n - 1) + fibonacci(n - 2));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment