---------- // statements_break2.cs // break and switch using System; class Switch { static void Main() { Console.Write("Enter your selection (1, 2, or 3): "); string s = Console.ReadLine(); int n = Int32.Parse(s); switch (n) { case 1: Console.WriteLine("Current value is {0}", 1); break; case 2: Console.WriteLine("Current value is {0}", 2); break; case 3: Console.WriteLine("Current value is {0}", 3); break; default: Console.WriteLine("Sorry, invalid selection."); break; } } } ---------- // statements_break.cs using System; class BreakTest { static void Main() { for (int i = 1; i <= 100; i++) { if (i == 5) { break; } Console.WriteLine(i); } } } output: 1 2 3 4 ---------- // statements_break2.cs // break and switch using System; class Switch { static void Main() { Console.Write("Enter your selection (1, 2, or 3): "); string s = Console.ReadLine(); int n = Int32.Parse(s); switch (n) { case 1: Console.WriteLine("Current value is {0}", 1); break; case 2: Console.WriteLine("Current value is {0}", 2); break; case 3: Console.WriteLine("Current value is {0}", 3); break; default: Console.WriteLine("Sorry, invalid selection."); break; } } } input: 1 output: Enter your selection (1, 2, or 3): 1 Current value is 1 ---------- // statements_break2.cs // break and switch using System; class Switch { static void Main() { Console.Write("Enter your selection (1, 2, or 3): "); string s = Console.ReadLine(); int n = Int32.Parse(s); switch (n) { case 1: Console.WriteLine("Current value is {0}", 1); break; case 2: Console.WriteLine("Current value is {0}", 2); break; case 3: Console.WriteLine("Current value is {0}", 3); break; default: Console.WriteLine("Sorry, invalid selection."); break; } } }