模板网首页 > 建站教程 > dart >  Dart编程实例 算术操作符正文

Dart编程实例 算术操作符

Dart编程实例 算术操作符

void main() {

   var num1 = 101;

   var num2 = 2;

   var res = 0;

   res = num1+num2;

   print("Addition: ${res}");

   res = num1-num2;

   print("Subtraction: ${res}");

   res = num1*num2;

   print("Multiplication: ${res}");

   res = num1/num2;

   print("Division: ${res}");

   res = num1~/num2;

   print("Division returning Integer: ${res}");

   res = num1%num2;

   print("Remainder: ${res}");

   num1++;

   print("Increment: ${num1}");

   num2--;

   print("Decrement: ${num2}");

}
0
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
选择头像:
最新评论

猜你喜欢