I am trying to write a silly little program that will let me run and display a do loop that will allow me to have a little popup display that shows the Fibonacci sequence generated.
I am looking to see where I would need to go next on this as I cannot figure out how to get the results of the loop into the Message String for display.
If anyone can take a look and point me to what I am missing... it would be appreciated.
ALSO: by using the Do Until cnt >= 610, am I generating 610 numbers or 15? I know F15 = 610. But I am not sure if I am coding that wrong.
Code:
Private Sub DoLoopButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DoLoopButton.Click
Dim X As Integer
Dim Y As Integer
Dim cnt As Integer 'Our counter.
Dim MessageString As String
cnt = 1
Do Until cnt >= 610
X = Y + X
Y = X - Y
cnt = cnt + 1
Loop
MessageString = "Do Loop Results:" & Environment.NewLine & Environment.NewLine
MessageBox.Show(MessageString, "Do Loop Testing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End Sub