Professional Documents
Culture Documents
Class 03
Class 03
Class 03
Expressions
Types of Expressions:
1. Arithmetic Expressions
2. Relational Expressions
3. Logical Expressions
Boolean Expression
Class 03 1
boolean expresions can compare data of any type as long as both parts of the
expressions have the same basic data type (relational)
1 is true
0 is alwas false
Relational Expression
relational refers to the relationhip value can have with one another.
Class 03 2
Logical Expression
Class 03 3
UNA AN ARITHMETIC, THEN RELATIONAL, THEN LOGICAL
Ternary Operations
Ternary operator uses question mark (?) and colon (:) symbols
Syntax: expression1?expression2:expression3;
expression1 is evaluated
else expression3 is evaluated and its value becomes the value of the
expression
Class 03 4