RosettaCodeData/Task/Fibonacci-sequence/Xojo/fibonacci-sequence.xojo

15 lines
240 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
Function fibo(n As Integer) As UInt64
Dim noOne As UInt64 = 1
2026-04-30 12:34:36 -04:00
Dim noTwo As UInt64 = 1
2023-07-01 11:58:00 -04:00
Dim sum As UInt64
For i As Integer = 3 To n
sum = noOne + noTwo
noTwo = noOne
noOne = sum
Next
Return noOne
End Function