Do Loop İle Fibonacci Serisi Hesaplama VB.Net
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim deger(1000), sonuç, sayac As Long ListBox1.Items.Clear() deger(0) = 0 ListBox1.Items.Add("1-) " + deger(0).ToString()) deger(1) = 1 ListBox1.Items.Add("2-) " + deger(1).ToString()) sayac = 2 Do While sayac < Val(TextBox1.Text) sayac = sayac + 1 sonuç = deger(0) + deger(1) deger(0) = deger(1) deger(1) = sonuç ListBox1.Items.Add(sayac.ToString + "-) " + sonuç.ToString()) Loop TextBox1.Clear() TextBox1.Focus() ListBox1.Items.Remove(ListBox1.SelectedItem) End Sub