While Example

While Examples

While Example 1
Class Program
    Private Shared Sub Main(ByVal args As String())
        Dim n, i As Integer
        Console.WriteLine("Enter any number")
        n = Integer.Parse(Console.ReadLine())
        i = 1

        While i <= 10
            Console.WriteLine("{0}X{1}={2}", n, i, (n * i))
            i += 1
        End While
    End Sub
End Class

While Example 2
Class Program
    Private Shared Sub Main(ByVal args As String())
        Dim l, h, i As Integer
        Console.WriteLine("Enter Low and High values")
        l = Integer.Parse(Console.ReadLine())
        h = Integer.Parse(Console.ReadLine())

        While l <= h
            i = 1

            While i <= 10
                Console.WriteLine("{0}X{1}={2}", n, i, (n * i))
                i += 1
            End While

            Console.ReadKey()
            l += 1
        End While
    End Sub
End Class


©Copyright 2016 All Rights Reserved LearnDotNetHome.com