answersLogoWhite

0

i=0;

do{

i++;

}while(i<10);

User Avatar

Destin Jones

Lvl 10
2y ago

Still curious? Ask our experts.

Chat with our AI personalities

RossRoss
Every question is just a happy little opportunity.
Chat with Ross
FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran
MaxineMaxine
I respect you enough to keep it real.
Chat with Maxine
More answers

int main (int argc, char **argv)

{

int i=0;

do printf ("%d '%s'\n", i, argv[i]); while(++i

return 0;

}

User Avatar

Wiki User

14y ago
User Avatar

Add your answer:

Earn +20 pts
Q: Do while loop examples
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Basic Math

How does a WHILE loop work in GML?

The while loop works as follows:{while( [expression is true] ) {//Do this code}}The while loop re-runs until the expression contained within the parentheses is false. Take a look at this example:{while(!place_meeting(x,y,obj_ground)) {y += 1;}}This while loop tells the object to move down one pixel until it collides with obj_ground. Unfortunately, nothing guarantees that this loop will not run forever. Always make sure that when you construct a while loop that you make sure that it does not run forever. Take a look at this whileloop:{while(obj_ball.y < y) {draw_sprite(sprite_index,0,x,y);}} This while loop will run for ever. Why? It does not have any statements that insure that the while loop aborts. Again, Always make sure that when you construct a loop that you put statements in the loop that will eventually abort the loop. y -= 1; is the statement in this new while loop that eventually aborts the loop:{while(obj_ball.y < y) {draw_sprite(sprite_index,0,x,y); y -= 1;}}


Which loop is used in php?

while, do...while, for, foreach are used


What is the purpose of wend statement in while loop in gw-basic?

While--wend statement is used to execute a loop until a given condition is true.if the condition is false the loop ends and the program continous to the line following eend.


How to use while loop statement in php?

simple code example: &lt;? while ($a &lt; 10 ) { echo "$a, "; $a++; } echo "Finished"; ?&gt; Will output, 1, 2, 3, 4, 5, 6, 7, 8, 9, Finished this will run through the loop WHILE $a is less than 10, outputting the value of $a to the screen. once $a = 10 then the loop will end and continue on with the rest of the script


How do you create a loop using PHP?

There are a number of different ways to loop using PHP. They're as follows:ForForeachWhileDo-whileBelow are some examples of how each of these types of loop work.ForForeachWhileDo-while