void main() {
// while loop
int total = 0;
while (total < 10) {
total += 1;
}
print(total);
// do while 문
total = 0;
do {
total += 1;
} while (total < 10);
print(total);
// break를 사용한 경우
total = 0;
while (total < 10) {
total += 1;
if (total == 5) {
break;
}
}
print(total);
}
10
10
5