3.8k views
1 vote
Which of the following statements are true? Select one or more: A. (x > 0 || x < 10) is same as ((x > 0) || (x < 10)) B. (x > 0 || x < 10 && y < 0) is same as ((x > 0 || x < 10) && y < 0) C. (x > 0 || x < 10 && y < 0) is same as (x > 0 || (x < 10 && y < 0)) D. (x > 0 && x < 10) is same as ((x > 0) && (x < 10))

User Bidby
by
9.0k points

2 Answers

1 vote

Answer:

The three options are true

A. (x > 0 || x < 10) is same as ((x > 0) || (x < 10))

C. (x > 0 || x < 10 && y < 0) is same as (x > 0 || (x < 10 && y < 0))

D. (x > 0 && x < 10) is same as ((x > 0) && (x < 10))

Explanation:

The order of precedence is that && is performed first, || next.

Brackets can be used to separate single entity without losing the meaning

User Johnny Kutnowski
by
7.8k points
3 votes

Answer:

Option A, C and D

Explanation:

This are examples of mathematical expression used as comparison operands in programing.

User Tufan Chand
by
7.9k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.