nerdexam
Microsoft

98-382 · Question #10

Variable x has a value of 5. Variable y has a value of 7. For each of the following expressions, select True if the statement evaluates to true. Otherwise, select False. NOTE: Each correct selection…

The correct selections are: 1. x < 7 && y > 6 (True) (5 < 7 && 7 > 6 -> true && true -> true) 2. x == 6 || y == 6 (False) (5 == 6 || 7 == 6 -> false || false -> false) 3. x != 7 (True) (5 != 7 -> true) 4. !(x == y) (True) (!(5 == 7) -> !(false) -> true)

Perform Operations using Data Types and Operators

Question

Variable x has a value of 5. Variable y has a value of 7. For each of the following expressions, select True if the statement evaluates to true. Otherwise, select False. NOTE: Each correct selection is worth one point. Expressions: 1. x < 7 && y > 6 2. x == 6 || y == 6 3. x != 7 4. !(x == y)

Explanation

The correct selections are: 1. x < 7 && y > 6 (True) (5 < 7 && 7 > 6 -> true && true -> true) 2. x == 6 || y == 6 (False) (5 == 6 || 7 == 6 -> false || false -> false) 3. x != 7 (True) (5 != 7 -> true) 4. !(x == y) (True) (!(5 == 7) -> !(false) -> true)

Topics

#logical operators#boolean expressions#&&#||

Community Discussion

No community discussion yet for this question.

Full 98-382 Practice