C# - Break statement: break

Used for the immediate interruption of the loop. after execution, will proceed with the following command after loop.

break

Description

break ;
Used keywords: break

Examples

C#

Even one example in what situations we can use the operation break statement:
i=10;
do --i; while ( i > 0);
do {
  i++;
  if (i==5)
    break;
} while ( i <10);

C#

Other pieces of example codes:
if (i==10)
     break;
   else 
   {
     i--;
   }
Languages: en hu cz sk