7. Write a VB program to find Fibonacci series up to given term (use InputBox).


Private Sub cmdClear_Click()
frmFibo.Cls
End Sub

Private Sub cmdDisplay_Click()
n = InputBox(“Enter The Terms”)
a = 0
b = 1
Print “Fibonacci Series is : ”
Print a
Print b
For i = 1 To n – 2
c = a + b
a = b
b = c
Print c
Next
End Sub

Private Sub cmdExit_Click()
Unload Me
End Sub

 

2 thoughts on “7. Write a VB program to find Fibonacci series up to given term (use InputBox).

  1. vetaia says:

    can u write a write a program that will write a sequence of 1,2,2,3,3,3,4,4,4,4,5,5,5,5,5,….in excel vba

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s