Dart Programming – Assignment Operators

  • Post author:
  • Post category:Dart
  • Post comments:2 Comments
Dart Programming assignment Operators

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

This Post Has 2 Comments

Leave a Reply