Created
April 22, 2022 13:27
-
-
Save OlgaEle/9c40de77740ff60e955b660d5d3e0735 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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