Last active
June 1, 2016 16:02
-
-
Save abhijithanilkumar/628c916a0c1ee1d9d29012ea599263a3 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
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