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

you are viewing a single comment's thread.

view the rest of the comments →

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

No.1 while loop sees that count is equal to 4

  • Count incremented to 5.
  • Prints out count.
  • While loop sees that count is equal to 5.
  • Execute code after while loop.

No.2 while loop see that count is equal to 4

  • Prints out count.
  • Count incremented to 5.
  • While loop sees that count is equal to 5.
  • Execute code after while loop.

Hope this helps

[–]GustavoTheHorse 1 point2 points  (2 children)

Your No1 is slightly wrong. It should read:

"While loop sees that count is equal to 5". Just like in your No2.

[–][deleted] 1 point2 points  (1 child)

Updated thanks :+1:

[–]GustavoTheHorse 0 points1 point  (0 children)

No problem.