false statements. Unlike strings or numbers, booleans store statements of truth: is what I am saying true or false? For example, if I ask, “Are you a robot?", this question produces a
false result, which we call a Boolean. In this case, since you are not a robot (hopefully!), we would produce
We can also use math operators to create boolean expressions. Here are some examples; however, notice the unusual symbols for “equal to” and “not equal to”:
|Less than||Greater than|
|Less than or equal to||Greater than or equal to|
|Equal to||Not equal to|
As usual, use
Console.WriteLine to print out your results:
Console.WriteLine(10 < 8); Console.WriteLine((3 * 6) == (32 - 14));
Try guessing the answers to the following expressions. Use
Console.WriteLine to check your answers.
54 < (10 + 32)
(37 / 5) == 7
"Hello" + "World" == "Hello World"
false == false