Skip to content

Instantly share code, notes, and snippets.

@gurimusan
Created March 11, 2016 05:07
Show Gist options
  • Save gurimusan/793b7afc9db97f6fe0fb to your computer and use it in GitHub Desktop.
Save gurimusan/793b7afc9db97f6fe0fb to your computer and use it in GitHub Desktop.
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