Skip to content

Commit

Permalink
dart implementation for fibonacci and factorial
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerbryto committed Oct 15, 2018
1 parent 3615be3 commit 825dcdc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions math/factorial/dart/factorial.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
void main() {
print('!1 = ${factorial(1)}');
print('!2 = ${factorial(2)}');
print('!3 = ${factorial(3)}');
print('!4 = ${factorial(4)}');
print('!5 = ${factorial(5)}');
print('!6 = ${factorial(6)}');
print('!7 = ${factorial(7)}');
}

int factorial (int n) => n > 1 ? n * factorial(n-1) : 1;

0 comments on commit 825dcdc

Please sign in to comment.