Dart编程实例 - break 语句

本文为大家分享 Dart编程实例 - break 语句 的具体示例代码,提供大家参考,具体内容如下:

void main() {
   var i = 1;
   while(i<=10) {
      if (i % 5 == 0) {
         print("The first multiple of 5  between 1 and 10 is : ${i}");
         break ;    
         //exit the loop if the first multiple is found
      }
      i++;
   }
}

本文为大家分享 Dart编程实例 - continue 语句 的具体示例代码,提供大家参考,具体内容如下:void main() { var num = 0; var count = 0; fo ...