Do While…Loop in Visual Basic .NET

This kind of loop iterate while the given condition is true
We will try to print numbers from 1 to 10 using Do While … 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 while the count is less than 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

Leave a Reply

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