I'm new to programming. What is the difference between a while and do while loop?
Printable View
I'm new to programming. What is the difference between a while and do while loop?
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);
oops... your right Sly Maelstrom...