Difference of Break: in For and While


It was told that if we apply break statement in while and for loop they will act a biy differently.
For 'while' loop the condition will be executed at-least for once but for 'for' loop it won't.
I want to know the logic behind this. Shall be highly obliged if one can state that! Thanks in Advance :slight_smile:

Replace this line with your code.


break stops the loop, it doesn't affect whether there's a first iteration or not


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.