break
break immediately exits the nearest enclosing loop or switch.
for (int i = 1; i <= 10; i++){ if (i == 4) break; Console.WriteLine(i);}Run the Application
Section titled “Run the Application”dotnet runResult
Section titled “Result”123