Assignment Operator
ஒரு value ஐ ஒரு variable-க்கு assign செய்ய பயன்படுத்தகூடிய operator, assignment operator என்று அழைக்கபடுகிறது. இதில் equalto "=" என்ற binary operator பயன்படுத்தபடுகிறது.
Note: ஒரு variable-ன் datatype எதுவாக இருக்கிறதோ அந்த value-ஐ தான் assign செய்ய முடியும். மாற்றி assign செய்தால் compiler will raise the error.
Assignment Operator Types and its description
| Operator | Name | Description | Result |
|---|---|---|---|
| = | Equal to | g=30; | 30 |
| += | Plus equal to |
p=10; p+= 70; (shorthand method) p= p+70; (Normal) |
80 |
| *= | Multiple equal to |
v=40; v*= 20;(shorthand method) v= v*20;(Normal) |
800 |
| -= | Minus equal to |
g=40; g-= 20;(shorthand method) g= g-20;(Normal) |
20 |
| /= | Divide equal to |
g=40; g/= 10;(shorthand method) g= g/10;(Normal) |
4 |
| %= | Remainder equal to |
yam=75; yam%= 7;(shorthand method) yam= yam%7;(Normal) |
5 |
இது பற்றிய தங்களின் கருத்துகளை இங்கே பதிவிடுங்கள் . இது பயனுள்ளதாக விரும்பினால் மற்றவர்களுக்கும் இதை share செய்யுங்கள்.
Comments