////////////////////////////////////////////////////////////////// // File: BoolType.cs // Class: BoolType // This program tests C# boolean types. // -Kyoung Shin Park (2009 Fall) ////////////////////////////////////////////////////////////////// using System; class BoolType { static void Main( string[] args ) { bool boolVal = true; Console.WriteLine(boolVal); bool boolVal2 = false; Console.WriteLine(boolVal2); int x = 123; if (x != 0) Console.WriteLine("The value {0} is non-zero", x); else Console.WriteLine("The value {0} is zero", x); Console.Write("Enter a character: "); char c = (char)Console.Read(); if (Char.IsLetter(c)) if (Char.IsLower(c)) Console.WriteLine("The character is lowercase."); else Console.WriteLine("The character is uppercase."); else Console.WriteLine("The character is not an alphabetic character."); // Keep the console window open in debug mode. Console.WriteLine("Press any key to exit."); Console.ReadKey(); } }