- Learn C# in 7 days
- Gaurav Aroraa
- 75字
- 2021-07-08 09:51:28
Nested if statement
Nested if statements are nothing but if statement blocks within if statement blocks. Similarly, we can nest else if statement blocks. This is a simple code snippet:
private static void NestedIfStatementExample() { WriteLine("nested if statement example."); Write("Enter your age:"); int age = Convert.ToInt32(ReadLine()); if (age < 18) { WriteLine("Your age should be equal or greater than 18yrs."); if (age < 15) { WriteLine("You need to complete your school first"); } } }
推薦閱讀
- Dynamics 365 for Finance and Operations Development Cookbook(Fourth Edition)
- Learning Real-time Processing with Spark Streaming
- JIRA 7 Administration Cookbook(Second Edition)
- Web全棧工程師的自我修養
- Apache Karaf Cookbook
- SQL Server與JSP動態網站開發
- 圖數據庫實戰
- Oracle GoldenGate 12c Implementer's Guide
- 智能搜索和推薦系統:原理、算法與應用
- Android應用開發實戰
- Julia數據科學應用
- Mastering Embedded Linux Programming
- 零基礎學SQL(升級版)
- 計算機應用基礎(Windows 7+Office 2010)
- 可視化H5頁面設計與制作:Mugeda標準教程