When a break statement is executed inside a loop, it skips the remaining statements of that loop and
control is immediately transferred outside the loop.
Syntax
break;
For example,
void main( )
{
int i, j;
for(i=1; i<=3;i++)
{
for(j=1;j<=3;j++)
{
if(i= =j)
break;
else
printf(“%d\t %d”, i, j);
}
}
}
}
Do'stlaringiz bilan baham: