In the world of programming (unlike in the real world), everything is black or white, right or wrong, true or false. For example, if you create an integer variable called x, assign the value 99 to x, and then ask, “Does x contain the value 99?”, the answer is definitely true. If you ask, “Is x less than 10?”, the answer is definitely false. These are examples of Boolean expressions. A Boolean expression always evaluates to true or false.
Microsoft Visual C# provides a data type called bool. A bool variable can hold one of two values: true or false. For example, the following three statements declare a bool variable called areYouReady, assign true to the variable, and then write its value to the console:
bool areYouReady; areYouReady = true; Console.WriteLine(areYouReady); // writes True