TODAY JAVA SCHOOL

In java school, programming, design, computer general knowledge, web application, software, web services, social media, digital marketing, oops, concept of programming language, oops feature, console media, graphics medium, first programming, c, c ++ , Java, PHP, SQL, MySQL, HTML, HTML_5, J_query, JavaScript, Bootstrap, Framework, images with logos, examples, shared and explained.

https://www.amazon.in/b?node=26373545031&linkCode=ll2&tag=1234567801cdb-21&linkId=3b9882431b00409b44141e0344b35a15&language=en_IN&ref_=as_li_ss_tl

Breaking

Sunday, 10 May 2020

Break Statement In C Language | Break Statement In C Language In Hindi

Break Statement In C Language

The break ends the loop immediately when it is encountered.
When a break statement is encountered inside a loop, the control directly comes out of loop and the loop gets terminated. It is used with if statement, whenever used inside loop.

This can also be used in switch case control structure. Whenever it is encountered in switch-case block.


Syntax:

break;

download image of break statement in c

Fig: break statement in c  


Program

#include<stdio.h>
#include<conio.h>
void main()
{
int    num;
for(num=100;num>=10;num--)       
{
printf(“num:%d\n”,num);
if(num==99)
{
break;
}
}
printf(“out of loop”);
getch();
}


Output:

num:100
num:99
out of the loop 

No comments:

Post a Comment