Created
April 22, 2022 13:00
-
-
Save OlgaEle/142b6ea74524d872eb96572a1f53e8da 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
| 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