Break statement inside two while loops

后端 未结 11 1211
时光取名叫无心
时光取名叫无心 2020-12-24 14:00

Let\'s say I have this:

while(a){

  while(b){

   if(b == 10)
     break;
 }
}

Question: Will the break statement take m

11条回答
  •  温柔的废话
    2020-12-24 14:58

    A break statement will take you out of the innermost loop enclosing that break statement.

    In the example the inner while loop.

提交回复
热议问题