Repeat until 0 (Use Do While) Learn programming Visual Basic (VB.net)

Lesson:

Flow Control


Exercise:

Repeat until 0 (Use Do While) 15


Objetive:

Create a Visual Basic (VB.net) program to ask the user for a number "x" and display 10*x. It must repeat until the user enters 0 (using "do-while").


Code:

Imports System
Public Class Exercise21
    Public Shared Sub Main()
        Dim number As Integer

        Do
            Console.Write("Enter a number: ")
            number = Convert.ToInt32(Console.ReadLine())
            Console.WriteLine(number * 10)
        Loop While number <> 0
    End Sub
End Class