25.9k views
1 vote
Given that the variables x and y have already been declared and assigned values, write an expression that evaluates to true if x is non-negative and y is negative. Instructor Notes: An expression can be a logical condition. E.g.: Logical Condition: A statement that uses any logical operator. age

User Egl
by
5.6k points

1 Answer

4 votes

Answer:

x>0 & y<0

Step-by-step explanation:

& is for AND operator. It is used when both conditions are true.

Here conditions are,

x>0 that is x is positive

y<0 that is y is negative

So if x is positive and y is negative then the following expression will evaluate to true

x>0 & y<0

User Rakesh Goyal
by
5.6k points