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



Lesson:

Flow Control


Exercise:

Repeat until 0 (Use Do While)


Objetive:

Create a Visual Basic (VB.net) program that asks the user for a number "x" and displays 10*x. The program must repeat the process 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



Juan A. Ripoll - Systems Tutorials and Programming Courses ©  All rights reserved.  Legal Conditions.