Summary -
In this topic, we described about the Combined Condition with detailed example.
Two or more conditions can be logically connected to form a combined condition.
Syntax -

The condition to be combined can be any of the following ones -
- A simple-condition
- A negated simple-condition
- A combined condition
- A negated combined condition
- A combination of the preceding conditions
Parentheses are never needed when either ANDs or ORs (but not both) are used in one combined condition. However, parentheses used to modify the precedence rules to maintain the correct logical relation of operators and operands.
There must be a one-to-one correspondence between left and right parentheses. That is, one left parenthesis has its corresponding right parentheses. The below table describes the relationships between logical operators for the conditions C1 and C2 -
Value for C1 | Value for C2 | C1 AND C2 | C1 OR C2 | NOT (C1 AND C2) | NOT (C1 OR C2) |
---|---|---|---|---|---|
True | True | True | True | False | False |
False | True | False | True | True | False |
True | False | False | True | True | False |
False | False | False | False | True | True |