G+_Ash Chetri Posted February 7, 2014 Share Posted February 7, 2014 While loop with Fibonacci numbers! Public Class Form1 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 fib As Integer = 0 Do fib = a + b a = b b = fib Label1.Text = Label1.Text + fib.ToString & ControlChars.NewLine Loop While fib < 55 End Sub End Class Link to comment Share on other sites More sharing options...
G+_Joe C. Hecht Posted February 7, 2014 Share Posted February 7, 2014 Very nice! Can you site one of the 61 websites that it came from? Link to comment Share on other sites More sharing options...
G+_Ash Chetri Posted February 7, 2014 Author Share Posted February 7, 2014 Good ole Stack Overflow :] http://stackoverflow.com/questions/5531722/fibonacci-sequence-in-vb-net-using-loop Link to comment Share on other sites More sharing options...
Recommended Posts