User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







c:control_structures:break

Table of Contents

break

   syntax
   break;
   
   Description: break ends a loop immediately

C Sourcecode Example

#include <stdio.h> /* including standard library */
//#include <windows.h> /* uncomment this for Windows */
 
 
int main ( void ) {
 
int i;
i=0;
 
while (1) {
    i++;
    if (i==42) {
        break;
        }
  }
 
printf("The answer is %i\n",i);
return 0;
}

output

  cd@najai:~$ ./break 
  The answer is 42
advertising
c/control_structures/break.txt · Last modified: 2013/01/22 22:02 (external edit)

Impressum Datenschutz

Creating directory /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2021 failed
Writing /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2021/misc_data.ser failed
Creating directory /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2021 failed
Writing /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2021/ip.ser failed
Creating directory /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2021 failed
Writing /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2021/pages.ser failed
Creating directory /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2021 failed
Writing /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2021/ua.ser failed
Creating directory /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2021 failed
Writing /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/10_2021/page_users.ser failed