if statement with bool variable : Boolean Data Type : Data Type C# Examples


C# Examples » Data Type » Boolean Data Type »

 

if statement with bool variable









    
using  System;

public  class  MainClass  {
    public  static  void  Main(  )  {
        bool  boolValue1  =  true;
        bool  boolValue2  =  false;


        if(  boolValue1  )  
            Console.WriteLine("You  should  see  this");

        if(  boolValue2  )
            Console.WriteLine("You  should  not  see  this");

        if(  boolValue1  &&  !boolValue2  )
            Console.WriteLine("Will  you  see  this?");

        if(  boolValue1  )  {
            Console.WriteLine("Statement  1");
            Console.WriteLine("Statement  2");    
        }
    }
}
    
   
  
   



Output

You should see this
Will you see this?
Statement 1
Statement 2


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Boolean Data Type