- Hands-On Object:Oriented Programming with C#
- Raihan Taher
- 107字
- 2021-07-02 12:44:36
Continue
This is used to invoke the next iteration. The contextual keyword allows the developer to continue to the next step without executing any further code in the block.
Now, let's look at how we can use both of these contextual statements in our program:
var x = 0;
while(x<=10)
{
x++;
if(x == 2)continue;
Console.WriteLine(x);
if(x == 5) break;
Console.WriteLine("End of loop body");
}
Console.WriteLine($"End of loop, X : {x}");
The preceding code will skip execution of the body for the iteration value, 2, because of the continue statement. The loop will execute until the value of x is 5 because of the break statement.
推薦閱讀
- Spring 5.0 By Example
- 潮流:UI設計必修課
- JavaScript Unlocked
- Software Testing using Visual Studio 2012
- Monitoring Elasticsearch
- Python數據挖掘與機器學習實戰
- NoSQL數據庫原理
- OpenGL Data Visualization Cookbook
- Practical GIS
- AutoCAD基礎教程
- Node.js實戰:分布式系統中的后端服務開發
- Python數據預處理技術與實踐
- H5頁面設計與制作(全彩慕課版·第2版)
- 大話C語言
- Continuous Integration,Delivery,and Deployment