using System; class Booleans { public static void Main() { bool content = true; bool noContent = false; Console.WriteLine("It is {0} that C# Station provides C# programming language content.", content); Console.WriteLine("The statement above is not {0}.", noContent); } }
>It is True that C# Station provides C# programming language content. >The statement above is not False.
2.下列表格顯示了各種整數類型,所占字節大小和所能表示的數的范圍。
類型 位 范圍 sbyte 8 -128 to 127 byte 8 0 to 255 short 16 -32768 to 32767 ushort 16 0 to 65535 int 32 -2147483648 to 2147483647 uint 32 0 to 4294967295 long 64 -9223372036854775808 to 9223372036854775807 ulong 64 0 to 18446744073709551615 char 16 0 to 65535
類型 位 精度 范圍 float 32 7 digits 1.5 x 10-45 to 3.4 x 1038 double 64 15-16 digits 5.0 x 10-324 to 1.7 x 10308 decimal 128 28-29 decimal places 1.0 x 10-28 to 7.9 x 1028