void setup { int sum = 0; Serial. Sometimes, using CTRL BREAK (QBasic 1.1) can end the infinite loop. Do Until loop has two kinds of syntax. This post is devoted to exploring the DoW Loop by example and the flexibility that it holds. Do While Loop Examples. print ("sum = "); Serial. The DO WHILE statement executes statements in a DO loop repetitively while a condition is true, checking the condition before each iteration of the DO loop. A do while loop is almost exactly the same as a do until loop—there’s just one crucial difference. Example 1 – Add First 10 Positive Integers using VBA. In programming, loops are used to repeat a block of code. Syntax. Do While also works when the condition becomes TRUE. These statements are executed over and over without any chance to get out of the DO-loop. Loops are control flow statements that allow code to be executed repeatedly based on a given condition. Here's the basic syntax for a do while loop: For example, if you want to show a message 100 times, then you can use a loop. Do [Perform Some Task] Loop Until [condition] Both look very similar, and there is one simple differentiation is there.