go to previous page   go to home page   go to next page        

Answer:

The expression evaluates to False. One way to show this is below. Assume that x contains 9 and y contains 7.

Boolean Expression

Review of Truth Tables

A truth table is another way to show the evaluation of a boolean expression. The rows of a truth table start with all possible truth values of the operands. The columns show the truth value of subexpressions containing the operands. The final column shows the full expression under consideration.

The table below shows the operands in its first two columns. (The operands are the relational expressions x<12 and y>10.) Each operand can be true or false, so there are four possible combinations of values and four rows showing them. The last column shows the output of the && operator with those values.

x < 12 y > 10 x < 12 && y > 10
F F F
F T F
T F F
T T T

Each row of the truth table shows one possible set of conditions. For example, if x contains 9 and y contains 7 then the third row of the table is selected.

QUESTION 2:

What row of the table is used when x contains 1 and y contains 23?