Do Until…Loop in Visual Basic .NET

This loop will run until certain condition meets
We will try to print numbers from 1 to 10 using Do Until ... Loop

Output

Count is now 0
Count is now 1
Count is now 2
Count is now 3
Count is now 4
Count is now 5
Count is now 6
Count is now 7
Count is now 8
Count is now 9

This loop is run until the count is equal to 10. When the count is equal to ten it will quite the loop
Inside the loop you have to use count = count + 1 for incrementing the count variable
Do Until … Loop iterate until the given condition true

Leave a Reply

Your email address will not be published. Required fields are marked *