Use a nested if statement to check the int value range in CSharp
Description
The following code shows how to use a nested if statement to check the int value range.
Example
//from ww w. j av a 2 s . c o m
using System;
public class MainClass
{
static void Main(string[] args)
{
int i = 5;
if (i > 0)
{
Console.WriteLine("more than 0");
if (i > 3)
{
Console.WriteLine("more than 3");
}
else
{
Console.WriteLine("less than 3");
}
}
}
}
The code above generates the following result.