2) Assignment operator: assignment operator is used to assign a values to a variable. the left side of the assignment operator is a variable.the right side of the assignment operator is a value.
There are different types of assignment operators:
3) Relational operator: The Relational operators are used for comparison of the values of two operands. if one operand is equal to the other operand or not.There are some relational operators are
(== , > , < , <= , >=, !=)
There are different types of assignment operators:
OPERATORS
|
DESCRIPTION
|
EXAMPLE
|
= (Assignment)
|
It assigns a values from right side operands to left side operand
|
x=y
|
+= (Addition assignment)
|
It will adds right operand to left operand and assign the result to
left
|
x += y is similar as x=x+y
|
-= (subtraction assignment)
|
It will subtract the right operand from the left operand and it will
assigns the result to left operand
|
x -= y is similar as x=x-y
|
*= (multiplication assignment)
|
It will multiply left operand with the right operand and assign the
result to left operand
|
x*=y is similar as x=x*y
|
/= (division assignment)
|
It will divides left operand with the right operand and assign the
result to left operand
|
x/=y is similar as x=x/y
|
%= (remainder assignment)
|
It will calculates the modulus using two operands and it will assign the result to left
operand
|
x%=y is similar as x=x%y
|
(== , > , < , <= , >=, !=)
Operator
|
Meaning
|
>
|
Greater than
|
<
|
Lesser than
|
>=
|
Greater than or equal to
|
<=
|
Lesser than or equal to
|
==
|
Equal to
|
!=
|
Not equal
|