|
Dim n As Integer, fib As Integer
Private Sub CMDDEL_Click()
Text1.Text = ""
Text1.SetFocus
End Sub
Private Sub CMDTROVA_Click()
If Not IsNumeric(Text1.Text) Then
Call CMDDEL_Click
Exit Sub
End If
n = Int(Text1.Text)
If n >= 0 Then
fib = (1 / Sqr(5)) * (((1 + Sqr(5)) / 2) ^ n - ((1 - Sqr(5)) / 2) ^ n)
MsgBox "Il numero corrispondente a FIBONACCI(" & n & ") è " & UCase(fib) & "!!!", vbInformation, "FIBONACCI(" & n & ")"
Else
Call CMDDEL_Click
End If
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
MsgBox "Programma realizzato da ALBERTKING82", vbInformation, "CREATORE"
End Sub
|
|