B = cint(InputBox("Mencari Bilangan Fibonacci ke berapa?"))
document.write "Bilangan Fibonacci ke-" & B & " adalah " & Fibo(B) & "
"
FUNCTION Fibo(byVal N)
IF N=1 THEN
Fibo = 0
ELSEIF N=2 THEN
Fibo = 1
ELSE
Fibo = Fibo(N-2) + Fibo(N-1)
END IF
END FUNCTION
No comments:
Post a Comment