Situation and break if used in conjunction

1.break can only be used in conjunction with the switch and loops, and if statements can not be used alone;

#incldue<stdio.h>
main(){
int a=0,b=9;
if(a<b)break;
}

wrong

To break and if statement, if it must be nested in a loop statement

#include<stdio.h>
main(){
    int i=9,b=4;
    for(int a=0;a<9;a++){
    if(i<b)
    break;
}
} 

 

Guess you like

Origin www.cnblogs.com/ma360359954/p/9721273.html