Skip to content

Instantly share code, notes, and snippets.

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

  • Save OlgaEle/9c40de77740ff60e955b660d5d3e0735 to your computer and use it in GitHub Desktop.

Select an option

Save OlgaEle/9c40de77740ff60e955b660d5d3e0735 to your computer and use it in GitHub Desktop.
macro fibo(n::Int64)
a = 0
b = 1
if n < 0
print("Incorrect Input")
elseif n == 0
return a
elseif n == 1
return b
elseif n>1
for i in 2:n
c = a + b
a = b
b = c
end
return b
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment