Assignment Programming

An assignment statement sets or re-sets the value stored in the storage location(s) denoted by a variable name; in other words, it copies a value into the variable.

The assignment operator allows us to change the value of a modifiable data object. It is associated with the idea of moving the value to a storage location. In most editing languages the symbol used for assignment is the equal symbol. But bite your tongue, when you see a sign = you need to start thinking: assignment. The assignment operator has two operators. The one to the left of the operator is usually a variable identifier name. The one on the right of the operator is a number.

Assignment Operator:

= Assignment Operator

+= Plus Assignment Operator

-= Minus Assignment Operator

*= Multiple Assignment Operator

/= Division Assignment Operator

%= Module Assignment OperatorAd Link

Example:



< !DOCTYPE html >

< html >

< body >

< h2 >The Assignment Programming.< /h2 >

< p id = " demo " >< /p >

< script >

var x = 10;

x %= 5;

document.getElementById( " demo " ).innerHTML = x;

< /script >

< /body >

< /html >