I'm new to programming. What is the difference between a while and do while loop?
I'm new to programming. What is the difference between a while and do while loop?
Last edited by noodle24; 02-12-2006 at 10:50 AM.
the difference is like this....
the statements will only be performed if the argument is true, then will continue to loop until falseCode:while {argument} {statement}
the statements will be performed at least once, before the argument is tested. Then if the argument is true it will continue to loop until false.Code:do {statement} while {argument}
I hope this helps
...and what rwmarsh said minus the syntax errors:
His explaination was correct, though.Code:while (conditional){ } do { } while(conditional);
Sent from my iPadŽ