Skip to content

Instantly share code, notes, and snippets.

@abhijithanilkumar
Last active June 1, 2016 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhijithanilkumar/628c916a0c1ee1d9d29012ea599263a3 to your computer and use it in GitHub Desktop.
Save abhijithanilkumar/628c916a0c1ee1d9d29012ea599263a3 to your computer and use it in GitHub Desktop.
f(a,b) = b,b+a # Function that computes the fibonacci number
function fibonacci(N::int64) # Function to find first N fibonacci numbers
a = 0 ; b = 1 # Errors can arise depending on the values taken for a and b.
for c in 1:N # Loop that runs N times
a,b = f(a,b)
@show a
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment