Where break keyword used ? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Where break keyword used ?

I think that it is used to terminate compound statement but what's the correct answer .

18th Jul 2016, 5:47 PM
manni bhaskar mallik
manni bhaskar mallik - avatar
4 Respuestas
+ 1
1,switch 2,for do-while while
18th Jul 2016, 6:01 PM
S1xe
S1xe - avatar
+ 1
It is used to terminate one case from another when using switch. Without break, if a case satisfies the condition then every following cases are executed causing an error.
18th Jul 2016, 6:12 PM
deepak h.s
deepak h.s - avatar
0
break; is used to prematurely break out of any loop, such as switch(), for() or while(). It is an essential component of a switch statement, however, in order to ensure that only one case is triggered.
18th Jul 2016, 6:31 PM
Cohen Creber
Cohen Creber - avatar
0
break keyword shows the termination of loop or in switch case statement
18th Jul 2016, 6:43 PM
krishna desai