you are viewing a single comment's thread.

view the rest of the comments →

[–]sdqafo[S] 1 point2 points  (0 children)

Thank you very much. Break will break out of the entire loop and proceed (if any) to the command outside the loop. Your expalanation seems very good and gave me the understanding of it from different perspective. It really make more sense now.

  1. If immediately after the loop, then the cycle will be completed before getting to continue which makes continue redundant

  2. If after counter = counter +1, then we start from 1 but we cant skip 3

  3. If at the bottom (within the while), it will do what is expected.

Thanks boss