In this guide, we will discuss Assignment Operators in Dart Programming Language.
Example
The following example shows how you can use the assignment operators in Dart −
void main() { var a = 12; var b = 3; a+=b; print("a+=b : ${a}"); a = 12; b = 13; a-=b; print("a-=b : ${a}"); a = 12; b = 13; a*=b; print("a*=b' : ${a}"); a = 12; b = 13; a/=b; print("a/=b : ${a}"); a = 12; b = 13; a%=b; print("a%=b : ${a}"); }
It will produce the following output −
a+=b : 15 a-=b : -1 a*=b' : 156 a/=b :0.9230769230769231 a%=b : 12
Next Topic : Click Here
Pingback: Dart Programming - Bitwise Operators | Adglob Infosystem Pvt Ltd
Pingback: Dart Programming - Operators | Adglob Infosystem Pvt Ltd