Skip to content

Instantly share code, notes, and snippets.

@devoncarew
Last active June 25, 2022 05:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save devoncarew/74e990d984faad26dea0 to your computer and use it in GitHub Desktop.
Save devoncarew/74e990d984faad26dea0 to your computer and use it in GitHub Desktop.
Fibonacci
// Copyright 2015 the Dart project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file.
void main() {
int i = 20;
print('fibonacci($i) = ${fibonacci(i)}');
}
/// Computes the nth Fibonacci number.
int fibonacci(int n) {
return n < 2 ? n : (fibonacci(n - 1) + fibonacci(n - 2));
}
@devoncarew
Copy link
Author

Test comment.

@devoncarew
Copy link
Author

Test comment.

@YBCS
Copy link

YBCS commented Oct 31, 2019

works!

@yogithesymbian
Copy link

test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment