首页 > 建站教程 > dart >  Dart编程实例 - Break 语句正文

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++;

   }

}