Break statement:
• The break statement is used to pass the control out of the loop, by breaking the loop.
• It is used only with loops and "switch...case" statements.
• It always transfers the control to the next statement that follows it.
• Break is usually used with condition.
• The break statement is always associated with loops and switch case statements.
• "break" is a keyword.
• Example
While(condition)
{ if(i<=10)
{break;}
printf("%d",i);
i=i+1;
}
No comments:
Post a Comment