129k views
2 votes
What does the following expression evaluate to, given that a = 3 and b = 6?

(a = b) OR (b>a)

User Everyone
by
7.8k points

1 Answer

4 votes

Answer: expression (a = b) OR (b > a) evaluates to True when a = 3 and b = 6

Explanation: Evaluate (a = b):

checking if a is equal to b.

a = 3, b = 6, so a is not equal to b.

(a = b) evaluates to False.

Evaluate (b > a):

if b is greater than a.

b = 6, a = 3, so b is indeed greater than a.

(b > a) evaluates to True.

Now, we have False OR True:

When you use the OR operator, the result is True if at least one of the operands is True.

In this case, we have one True operand.

(False OR True) evaluates to True.

User Juarez Lustosa
by
7.8k points