A good answer might be:
When execution got to theHow much flour do you have? 6 How much sugar do you have? 4 Enough for cookies! if statement, it found that
andflour >= 4 --- true, because 6 >= 4 Since both sides were true, the two part question gave us true.sugar >= 2 --- true, because 4 >= 2 |
AND Operator
The If both sides are true, the entire expression is true. If either side (or both) are false, the entire expression is false. "&&" is called a logical operator because it combines two true/false values into a single true/false value.this side must be true && this side must be true
A compact way of saying what && does is:
|
QUESTION 5:Look at the logical expression: What will the expression give us if flour is 2 and sugar is 0? Click Here after you have answered the questionflour >= 4 && sugar >= 2 |