- Learn C# in 7 days
- Gaurav Aroraa
- 87字
- 2021-07-08 09:51:29
The while loop
This executes the statement or code block until the condition evaluates to true. In this expression evaluates before the execution of code-block, if expression evaluates to false, loop terminates and no statement or code-block execute. Take a look at the following code snippet:
private static void WhileStatementExample() { WriteLine("while example"); Write("Enter repeatitive length:"); int length = Convert.ToInt32(ReadLine()); int count = 0; while (count < length) { count++; WriteLine(newstring('*', count)); } }
The preceding code executes the while statement repeatedly until expression evaluates to false.
推薦閱讀
- SQL Server 從入門到項目實踐(超值版)
- Hands-On Machine Learning with scikit:learn and Scientific Python Toolkits
- PyTorch自然語言處理入門與實戰
- aelf區塊鏈應用架構指南
- Java Web開發技術教程
- HTML5入門經典
- Hands-On Full Stack Development with Go
- R語言:邁向大數據之路(加強版)
- Clojure for Java Developers
- OpenCV 3計算機視覺:Python語言實現(原書第2版)
- Kotlin Programming By Example
- Distributed Computing in Java 9
- jQuery技術內幕:深入解析jQuery架構設計與實現原理
- ASP.NET開發寶典
- 原型設計:打造成功產品的實用方法及實踐