Which of the following is the correct expression that evaluates to true if the number x is between 1 and 100 or the number is negative?
a. 1 < x < 100 && x < 0
b. ((x < 100) && (x > 1)) || (x < 0)
c. ((x < 100) && (x > 1)) && (x < 0)
d. (1 > x > 100) || (x < 0)
b A and D have syntax errors. B uses || for the OR operator. The correct answer is B.
Computer Science & Information Technology
You might also like to view...
Finding ________ values and knowing what to do with them remains one of the challenges of good database design
Fill in the blank(s) with correct word
Computer Science & Information Technology
The JavaScript object _____ describes patterns of characters.?
A. ?RegExp B. ?DOM C. ?navigator D. ?screen
Computer Science & Information Technology