C++ Programming Blog

 
 
 

Image

 #include<iostream.h>
 #include<conio.h>



 //-----------------------------  Main( )  -------------------------------//



 main()
    {
       clrscr();

       cout<<\"\\n ********  Break Statement  *********\"<<endl;

       for(int count=1;count<=10;count++)
      {
         if(count==5)
        break;

         cout<<\" \"<<count;
      }

       cout<<\"\\n\\n Counting was broken at count = \"<<count<<endl;

       getch();
       return 0;
    }

 
 
Didn't find what you were looking for? Find more on Program to illustrate the use of the break statement