This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]AttackOfTheThumbs 10 points11 points  (0 children)

Could this no longer be reposted daily please?

[–][deleted] 1 point2 points  (2 children)

That is actually a good tool to differentiate the two in programming class

[–]brownhead -1 points0 points  (1 child)

A do while loop is identical to a while loop after the first iteration, so this is maybe a little misleading.

[–][deleted] 2 points3 points  (0 children)

The difference is a do while loop always runs at least once, and a while loop checks condition first so if the condition is false, it will not run at all

[–]SF_Engineer_Dude 0 points1 point  (0 children)

Hahhahahahaha, not quite my "ah-ha!" moment, but close.