AP Computer Science Logical Operators

Which of the following will be evaluated as true only if the logical expressions A, Band C- all false?

Answer: !(A || B || C)
My answer:!(A && B && C)

Why is my answer incorrect? If A, Band Ceverything is falsedistributed !, he will make all of them true, thereby returning true.


Given that A, Band Care integers, consider the Boolean expression

(a < b) || !((c == a * b) && (c < a))

Which of the following conditions ensures that the expression true?

The answer c < aisfalse

Does the result also rely (c == a * b)on falsebecause of &&?

+5
source share
5
  • : . A, B C true, !(A || B || C) false ( A || B || C true ! true false).

  • (c == a * b) false - &&?

    : c < a - false, (c == a * b) && (c < a) false, , ! ((c == a * b) && (c < a)) true, , true ( ||, , , true).

+2

true, - false. , , .

0

" ", , A B C , . true, , ,

0

-! . , . . , , , . ,

0

, , - . . .

I would suggest creating a truth table for your expression to verify its correctness.

0
source

All Articles