Send Close Add comments: (status displays here)
Got it!  This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
C: Conditions


1. C: Conditions

2. C: Conditions
A condition is an expression that evaluates to a Boolean value - true or false. At this point, there are two main types of conditions. Note: An arithmetic expression evaluates to a number literal value. A string expression evaluates to a string literal value.

3. Relational expressions
Relational expressions take arithmetic, character, or logical operands and evaluate to logical values.

4. Logical expressions
Logical expressions take logical operands and evaluate to logical values.

This will be covered in more detail later.

5. Relational operators
The following table shows relational operators used to compare two values.

6. Examples
Here are some examples of relational operators using literals. On the left is the expression. On the right is the Boolean/logical value to which it reduces. Never compare floating point approximations for equality or inequality.

Never compare values of different types.

7. End of page

8. Multiple choice questions for this page