the question is Using a Do...Loop While structure, write the code that repeatedly prompts the user using an InputBox for a number, and continues to prompt the user until a valid positive number is entered.
Unfortunately it doesn't work properly, where did I go wrong?
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim stringMagic As Double
Do
stringMagic = InputBox("Enter The Number", "Guess")
If stringMagic <> 51 Or Nothing Then
stringMagic = Val(stringMagic)
MsgBox("Try Again!")
End If
Loop While stringMagic = InputBox("Enter The Number", "Guess")
stringMagic = 51
MsgBox("Happy Birthday!")
End Sub
End Class
Bookmarks