What will happen if you do not use break statement?

1 answer

Answer

1124289

2026-07-31 15:00

+ Follow

Everywhere in the code when there is no 'break', the running will continue with the next instruction. Example:

for (i=0; i<3; ++i) {

printf ("i=%d: ", i);

switch (i) {

case 2: printf ("two ");

case 1: printf ("one ");

case 0: printf ("zero ");

}

printf ("\n");

}

The output:

0: zero

1: one zero

2: two one zero

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.