diff --git a/guide/english/csharp/break/index.md b/guide/english/csharp/break/index.md index 94dab17fe2..0dc09f694d 100644 --- a/guide/english/csharp/break/index.md +++ b/guide/english/csharp/break/index.md @@ -13,11 +13,8 @@ In the first example, when the value of i is 3, the break statement is executed, int[] array = { 1, 2, 3, 4, 5 }; for (int i = 0; i < array.Length; i++) { - if(i == 3) - { - break; - } - Console.WriteLine("Item on index {0} is {1}", i, array[i]); + if(i == 3) break; + Console.WriteLine("Item on index {0} is {1}", i, array[i]); } ``` @@ -37,12 +34,15 @@ switch (exampleVariable) Console.WriteLine("case 1"); Console.WriteLine("This only shows in example 1"); break; + case 2: Console.WriteLine("case 2"); Console.WriteLine("This only shows in example 2"); - Console.WriteLine("This also only shows in example 2"); + Console.WriteLine("This also only shows in example 2"); break; + Console.WriteLine("This would not show anywhere, as it is after the break line and before the next case"); + default: Console.WriteLine("default"); Console.WriteLine("This only shows in the Default Example"); @@ -52,15 +52,19 @@ switch (exampleVariable) ``` ## Output: +#### Executed with `exampleVariable = 1` ``` > case 1 > This only shows in example 1 -> +``` +#### Executed with `exampleVariable = 2` +``` > case 2 > This only shows in example 2 > This also only shows in example 2 -> +``` +#### Executed with `exampleVariable = 3` or any other number +``` > default > This only shows in the Default Example -> ```