A nested if statement : If : Statement C# Examples


C# Examples » Statement » If »

 

A nested if statement









    
class  MainClass
{

    public  static  void  Main()
    {

        int  intValue  =  1500;
        string  stringValue  =  "  ";

        if  (intValue  <  1000)
        {
            System.Console.WriteLine("intValue  <  1000");
        }
        else
        {
            System.Console.WriteLine("intValue  >=  1000");
            if  (stringValue  ==  "closed")
            {
                System.Console.WriteLine("closed");
            }
        }

    }

}
    
   
  
   



Output

intValue >= 1000


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Statement
» If