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}");
}

本文为大家分享 Dart编程实例 - 相等和关系操作符 的具体示例代码,提供大家参考,具体内容如下:void main() { var num1 = 5; var num2 = 9; var res ...