개념
<script>
/*
[무한 반복과 배수]
- 숫자 28의 배수를 차례로 구했을 때,
숫자 500 이상이 되는 첫 번째 배수를 출력하시오.
*/
/*
[출력예시]
504
*/
let count = 0;
let i = 1;
while(true) {
if(i >= 500 && i % 28 == 0) {
count += 1;
if(count == 1) {
document.write(i, " ");
break;
}
}
i += 1;
}
</script>
HTML
복사


