Fibonacci Numbers in VB.Net
Submitted by janobe on Wednesday, October 10, 2018 - 20:34.
In this tutorial, I will teach you how to create a sequence of Fibonacci Numbers in vb.net. This method has the ability to create a series of Fibonacci numbers depends of the terms that you’ve enter in the input box. Then it will be displayed in the Listbox. See the procedure below.
For any questions about this article. You can contact me @
Email – [email protected]
Mobile No. – 09305235027 – TNT
FB Account – https://www.facebook.com/onnaj.soicalap
Creating Application
Step 1
Open Microsoft Visual Studio 2015 and create a new windows form application. After that, do the form just like this.
Step 2
Double click the button to fire the click event handler
of it and do the following code for creating a sequence of Fibonacci Numbers.
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Dim input = InputBox(“Enter The Terms”)
- Dim a As Integer = 0
- Dim b As Integer = 1
- Dim c As Integer
- Dim i As Integer
- ListBox1.Items.Clear()
- ListBox1.Items.Add(“Fibonacci Series is : ”)
- For i = 1 To input - 2
- c = a + b
- a = b
- b = c
- ListBox1.Items.Add(c)
- Next
- End Sub
Add new comment
- 2659 views