8.2. Logical Operators
Logical operators are used along with control flow statements to branch the execution of the program logic based on whether a condition is true or false. The &&, ||, and ! operators perform a logical AND, a logical OR, and a logical negation operation, respectively, on their operands. The && and || operators are binary operators and require two operands, which can be any two expressions that evaluate to true or false boolean values. The ! operator is the negation operator, and it negates the expression it is attached to. The true and false operators can be used for checking whether a particular condition is true or false. To simulate an infinite while loop, you can use the true operator:
Listing 8.2 shows ...