VB.Net Program to Read a Name and Print 5 Times Using the Do Loop While

You are currently viewing VB.Net Program to Read a Name and Print 5 Times Using the Do Loop While

VB.Net program to read a name and print 5 times using the Do Loop While

'VB.Net program to read a name and print 5 times 
'using "Do Loop While" loop.

Module Module1

    Sub Main()
        Dim name As String = ""
        Dim count As Integer = 1

        Console.Write("Enter Name: ")
        name = Console.ReadLine()

        Do
            Console.WriteLine("{0} ", name)
            count = count + 1
        Loop While count <= 5

        Console.WriteLine()
    End Sub

End Module

Output

Enter Name: Shikar Dhawan
Shikar Dhawan
Shikar Dhawan
Shikar Dhawan
Shikar Dhawan
Shikar Dhawan

Press any key to continue . . .

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply