Unlike the real world, in the programming world, everything is black or white, right or wrong, true or false. For example, suppose you create an integer variable named x, assign the value 99 to X, and then ask, "Does x contain a value of 99?" "The answer is obviously affirmative. If you ask: "Is x less than 10?" "The answer is obviously negative. These are examples of Boolean (Boolean) expressions. A Boolean expression must evaluate to TRUE or false.
Note that not all programming languages will respond to these questions. For example, an unassigned variable has an undefined value and cannot be said to be less than 10. Because of this, novice in writing C and C + + program error prone. The Microsoft Visual C # compiler's solution to this problem is to make sure that a value has been assigned to it before checking for a value. If you attempt to check the contents of an unassigned variable, the program will not compile.
Microsoft Visual C # provides a data type named BOOL. A bool variable can hold only one of two values: TRUE or FALSE. For example, the following 3 statements declare a bool variable named Areyouready, assign a true value to it, and output its value on the console:
BOOL Areyouready;
Areyouready = true;
Console.WriteLine (Areyouready); Output true