- 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"); } } }
推薦閱讀
- PHP動態網站程序設計
- C語言程序設計習題解析與上機指導(第4版)
- FreeSWITCH 1.6 Cookbook
- Designing Hyper-V Solutions
- Mastering C# Concurrency
- Kotlin Standard Library Cookbook
- Hands-On Automation Testing with Java for Beginners
- Learning OpenStack Networking(Neutron)(Second Edition)
- 深度學習:Java語言實現
- Service Mesh實戰:基于Linkerd和Kubernetes的微服務實踐
- Julia for Data Science
- PHP項目開發全程實錄(第4版)
- Spring Boot學習指南:構建云原生Java和Kotlin應用程序
- LabVIEW數據采集(第2版)
- Lync Server Cookbook