Multiplication table (use while) Learn programming Visual Basic (


Flow Control


Multiplication table (use while)


Write a Visual Basic ( program that prompts the user to enter a number and displays its multiplication table using a 'while' loop.


Imports System
Public Class Exercise23
    Public Shared Sub Main()
        Dim num As Integer, multiplier As Integer = 1
        Console.Write("Insert a number to multiply: ")
        num = Convert.ToInt32(Console.ReadLine())

        While multiplier <= 10
            Console.WriteLine("{0} x {1} = {2}", num, multiplier, num * multiplier)
            multiplier += 1
        End While
    End Sub
End Class

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