The following conditional expression is written in the C language. It is true when the value of the variable a is outside the range of 20 to 30 (including end points) and false otherwise:

!(a < = 20 && a > = 30)

Which of the following conditional expressions is equivalent?
a) a>20 &&a<30
b) a<20 &&a>30
c) a>=20 &&a<=30
d) a>20 Ha<30
e) a < = 20 II a > = 30
f) a<20 Ila>30

d) a>20 Ha<30

Approach: Remove the not operator (!)
Flip applicable relational operators (< = becomes > and > = becomes <)
Flip applicable logical operators (&& becomes II)

Computer Science & Information Technology

You might also like to view...

All cells are locked by default, but the locking feature is only enabled when ________ is applied

A) protection B) locking C) security D) validation

Computer Science & Information Technology

Let x be an unsigned int on a machine with 4-byte unsigned ints. What effect does

x>>=1; x<<=1; have? a. There is no effect. b. The leftmost bit of x is set to 0. c. The rightmost bit of x is set to 0. d. Both (b) and (c).

Computer Science & Information Technology