Pages

Hello there!

Powered by Blogger.

Monday, January 7, 2013

BREAK STATEMENT IN C


BREAK STATEMENT IN C WITH EXAMPLE


Break statement is used to exit from loop

Break statement in loops

Break statement immediately transfer control to the out of loop and statement which is immediately after loop is executed. In other word break statement terminate loop.

Note:-
# Break is terminated only one loop in case of nested loop

Example:-

c program to count N number using break statement


Example:-

Break statement in nested loop



Break statement in switch

The break statement transfer the control to out of the switch statement and statement which is immediately after switch is executed. 

Note:-
# break is optional, if 2 or more case labels belongs to same statement.

Program to accept day number of week and display the corresponding week day



1 comments: