' Recursi ve Fibonacci Hesaplama
Option Explicit
Public Sub Main()
Dim lNum As Long
lNum = CInt(InputBox("Hangi Fibonacci Dizisini Istiyorsunuz?", _
"Fibonacci Numarasi"))
MsgBox "Fibonacci (" & lNum & ") is " & Fib(lNum)
End
End Sub
Public Function Fib(lNum As Long) As Long
If lNum <= 1 Then
Fib = lNum
Else
Fib = Fib(lNum - 1) + Fib(lNum - 2)
End If
End Function