.Net Programming

Fibonacci Series in VB.Net

In mathematics, the Fibonacci numbers are the following sequence of numbers:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, . . .

Language : VB.Net

The following is the Source Code of the program to generate Fibonacci Series in a TextField in VB.Net. For more programs on Fibonacci Series refer to the following:

[sourcecode language='vb']
Public Class fibonacci

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As Integer = 0
Dim b As Integer = 1
Dim f As Integer = 0
TextBox1.Text = “”
lblCount.Text = “”
Dim num As Integer = Val(txtNum.Text)
Dim i As Integer
While (f <= num)
TextBox1.Text = TextBox1.Text + Str(f)
f = a + b
a = b
b = f
i = i + 1
End While
lblCount.Text = i & ” Iterations”
End Sub
End Class
[/sourcecode]



{ 1 comment… read it below or add one }

1 harish March 24, 2011 at 6:32 am

Output Problem: when you run the program it show same ans for all number pls send curret program

Reply

Leave a Comment

Notify me of followup comments via e-mail. You can also subscribe without commenting.


WordPress - Vaibhav Kanwal