4. INCREMENT AND DECREMENT OPERATORINCREMENT AND DECREMENT OPERATORINCREMENT AND DECREMENT OPERATORINCREMENT AND DECREMENT OPERATOR
• These operators increase or decrease the
value of the operand by 1
• Increment increases by 1 while the decrement
decreases by 1
PREFIX VERSION
It follows the change then use rule i.e., it
first changes the value of the operand and
then use the new value to evaluate the
expression
POSTFIX VERSION
It follows the use then change rule i.e., it first
uses the new value of the operand in
evaluating the expression and then changes
the operands value
6. Relational operators refer to the relationship that values can have with one another .
Relational operators don’t work with string. We can compare numbers and characters with
them. If the comparison results in true , the relational operators results in the value 1 else it
results in the value 0 (comparison results in false).
7. LOGICAL OPERATORSLOGICAL OPERATORS
Logical AND
The resulting expressions
gives the value 1 only if
both the original operands
are true
Logical OR
The resulting expressions
gives the value 1 if either
of the original operands
is true
Logical NOT
It is a unary operator. It
reverses the truth value of the
expression and gives true if
the expression is false
11 Logical OR and Logical AND has lower precedence than relational operatorsLogical OR and Logical AND has lower precedence than relational operators
22 Logical NOT has higher precedence over any relational or arithimatic operatorLogical NOT has higher precedence over any relational or arithimatic operator
Facts about operatorsFacts about operators
8. CONDITIONAL OPERATOR ( ? : ) OR TERNARY OPERATORCONDITIONAL OPERATOR ( ? : ) OR TERNARY OPERATORCONDITIONAL OPERATOR ( ? : ) OR TERNARY OPERATORCONDITIONAL OPERATOR ( ? : ) OR TERNARY OPERATOR
9. SOME OTHER OPERATORSSOME OTHER OPERATORS
COMPILE TIME OPERATOR
• It returns the length (in
bytes) of the variable / type
specified
COMMA OPERATOR
IntegerInteger 2 Bytes2 Bytes
CharacterCharacter 1 Bytes1 Bytes
FloatFloat 4 Bytes4 Bytes
DoubleDouble 8 Bytes8 Bytes
• It is used to string together
several group of expressions.
The result of the rightmost
expression becomes the value
of the total comma seprated
expression
10. SOME OTHER OPERATORSSOME OTHER OPERATORS
COMPILE TIME OPERATOR
• It returns the length (in
bytes) of the variable / type
specified
COMMA OPERATOR
IntegerInteger 2 Bytes2 Bytes
CharacterCharacter 1 Bytes1 Bytes
FloatFloat 4 Bytes4 Bytes
DoubleDouble 8 Bytes8 Bytes
• It is used to string together
several group of expressions.
The result of the rightmost
expression becomes the value
of the total comma seprated
expression