Public Class Form1
Dim
P, Q, R, N, I As Integer
Private
Sub Button1_Click(ByVal
sender As Object,
ByVal e As
System.EventArgs) Handles
Button1.Click
ListBox1.Items.Clear()
P =
TextBox1.Text
Q =
TextBox2.Text
N =
TextBox3.Text
ListBox1.Items.Add("N"
& "
Fibonacci Series")
ListBox1.Items.Add(1 & vbTab & P)
ListBox1.Items.Add(2 & vbTab & Q)
For I = 3 To N
R = P +
Q
P = Q
Q = R
ListBox1.Items.Add(I & vbTab & R)
Next I
End
Sub
End Class
No comments:
Post a Comment
Note: only a member of this blog may post a comment.