Skip to content

Instantly share code, notes, and snippets.

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

  • Save OlgaEle/142b6ea74524d872eb96572a1f53e8da to your computer and use it in GitHub Desktop.

Select an option

Save OlgaEle/142b6ea74524d872eb96572a1f53e8da to your computer and use it in GitHub Desktop.
function 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