Fibonacci Numbers in VB.Net

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.

Creating Application

Step 1

Open Microsoft Visual Studio 2015 and create a new windows form application. After that, do the form just like this. fibonacci123

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.
  1. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  2.         Dim input = InputBox(“Enter The Terms”)
  3.         Dim a As Integer = 0
  4.         Dim b As Integer = 1
  5.         Dim c As Integer
  6.         Dim i As Integer
  7.  
  8.         ListBox1.Items.Clear()
  9.         ListBox1.Items.Add(“Fibonacci Series is : ”)
  10.         For i = 1 To input - 2
  11.             c = a + b
  12.             a = b
  13.             b = c
  14.             ListBox1.Items.Add(c)
  15.         Next
  16.     End Sub
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

Add new comment