Arithmetic Operators: Operator Description Example
Arithmetic Operators: Operator Description Example
Arithmetic Operators
Comparison Operators
Operator Description Example
== If the values of two operands are equal, then the (a == b) is not true.
condition becomes true.
<> If values of two operands are not equal, then (a <> b) is true. This is
condition becomes true. similar to != operator.
> If the value of left operand is greater than the value (a > b) is not true.
of right operand, then condition becomes true.
< If the value of left operand is less than the value of (a < b) is true.
right operand, then condition becomes true.
>= If the value of left operand is greater than or equal to (a >= b) is not true.
the value of right operand, then condition becomes
true.
<= If the value of left operand is less than or equal to the (a <= b) is true.
value of right operand, then condition becomes true.
Assignment Operators
Operator Description Example
a = 0011 1100
b = 0000 1101
-----------------
[ Show Example ]
& Binary AND Operator copies a bit to the result if it (a & b) (means
exists in both operands 0000 1100)
<< Binary Left The left operands value is moved left by a << 2 = 240
Shift the number of bits specified by the right (means 1111 0000)
operand.
and Logical If both the operands are true then condition becomes (a and b)
AND true. is true.
not Logical Used to reverse the logical state of its operand. Not(a
NOT and b) is
false.
not in Evaluates to true if it does not finds a variable x not in y, here not
in the specified sequence and false otherwise. in results in a 1 if x
is not a member of
sequence y.