break statement is used to break the further execution of a program and if it is used in any types of loops and when condition satisfies the loop will terminated, it is mainly used in cases in switch case condition.Let us see example to understand more about it.
Example:
#include<stdio.h>
#include<conio.h>
main()
{
int a=1;
clrscr();
while(a<=10)
{
printf("%d\n",a);
a++;
if(a==11)
{
break;
}
}
getch();
}
Example:
#include<stdio.h>
#include<conio.h>
main()
{
int a=1;
clrscr();
while(a<=10)
{
printf("%d\n",a);
a++;
if(a==11)
{
break;
}
}
getch();
}