Output a boolean variable with Console.WriteLine : boolean Data Type « Data Type « C# / CSharp Tutorial






using System; 
 
class Example { 
  public static void Main() { 
    Console.WriteLine("10 > 9 is " + (10 > 9)); 
  }
}
10 > 9 is True








2.2.boolean Data Type
2.2.1.The bool Type
2.2.2.Output a boolean variable with Console.WriteLine
2.2.3.bool values in if statement
2.2.4.if statement with bool variable
2.2.5.Declare 3 bools on a single line
2.2.6.Using ToString() to Convert to a string
2.2.7.Generic and nongeneric versions of the CompareTo method for Boolean type