개념
<script>
/*
[무한 반복과 배수2]
- 숫자 7의 배수를 작은 수부터 차례로 구하고,
처음 세 개만 출력하시오.
*/
/*
[출력예시]
7 14 21
*/
let count = 0;
let i = 1;
while(true) {
if(i % 7 == 0) {
document.write(i, " ");
count += 1;
if(count == 3) {
break;
}
}
i += 1;
}
</script>
HTML
복사


