Break Statement in C - tccicomputercoaching.com

Page 1

Break Statement in C tccicomputercoaching.com The break statement is used to exit from inside loops or switch statement.

The break statement is used to terminate the loop. As soon as the break statement is encountered from within a loop, the loop iterations stops there and control returns from the loop immediately to the first statement after the loop. Example of Break Statement: If we want to stop iteration from 6th number then apply condition with break statement. for(i=1;i<=10;i++) {

if(i==6) { break; } printf("hello world\n");

} i

op


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.