Created
March 11, 2016 05:07
-
-
Save gurimusan/793b7afc9db97f6fe0fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
discard """ | |
Run as following. | |
$ nim c -r --verbosity:0 fibonacci.nim | |
""" | |
proc fibonacci(n: int): int = | |
if n < 2: | |
return n | |
return fibonacci(n-1) + fibonacci(n-2) | |
echo(fibonacci(1)) | |
echo(fibonacci(10)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment