Several multiplication tables, (use do while) Learn programming Visual Basic (VB.net)

Lesson:

Flow Control


Exercise:

Several multiplication tables, (use do while)


Objetive:

Display multiplication tables from 2 to 6 using nested "do...while" loops.


Code:

Imports System
Public Class exercise33
    Public Shared Sub Main()
        Dim num, multiplier As Integer
        num = 2

        Do
            multiplier = 1

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

            Console.WriteLine()
            num += 1
        Loop While num <= 6
    End Sub
End Class

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