Assignment Operators
Assignment Operators
The most common assignment operator is = . This operator assigns the value in right side to the left side. For
example:
var=5
a=c;
//value of c is assigned to a
5=c;
// Error! 5 is a constant.
Operator
Example
Same as
a=b
a=b
+=
a+=b
a=a+b
-=
a-=b
a=a-b
*=
a*=b
a=a*b
/=
a/=b
a=a/b
%=
a%=b
a=a%b