Skip to content

Instantly share code, notes, and snippets.

@OlgaEle
Created April 22, 2022 13:31
Show Gist options
  • Select an option

  • Save OlgaEle/7bccbe1714a71acab9fd578de64d4982 to your computer and use it in GitHub Desktop.

Select an option

Save OlgaEle/7bccbe1714a71acab9fd578de64d4982 to your computer and use it in GitHub Desktop.
function fibo(n::Int64)
f = [0,1]
if n < 0
print("The input must be equal to or bigger than zero.")
else
for i in 3:n+1
push!(f, f[i-1] + f[i-2])
end
end
print(f[n+1])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment