<main id="main">
<div class="container">
<h2>1부터 100까지 출력하기</h2>
<div class="test_box">
<h3> class="title">1.1 while문을 이용해서 1부터 100까지 출력하세요!</h3>
<div class="code">
<pre><code> class="line-numbers language-js">let i = 1;
while(i <= 100) {
document.write(i)
i++;
}
</code></pre>
</div>
<div class="result">
<details>
<summary>결과 보기</summary>
<div> class="sample01_result">
<script>>
let i = 1;
while(i <= 100) {
document.write(i,"<br>")
i++;
}
</script>
</div>
</details>
</div>
</div>
<div class="test_box">
<h3> class="title">1.2 for문을 이용해서 1부터 100까지 출력하세요!</h3>
<div class="code">
<pre><code> class="line-numbers language-js">for( let i=1; i<=100; i++){
document.write(i)
}
</code></pre>
</div>
<div class="result">
<details>
<summary>결과 보기</summary>
<div> class="sample01_result">
<script>>
{
for( let i=1; i<=100; i++){
document.write(i,"<br>")
}
}
</script>
</div>
</details>
</div>
</div>
<div class="test_box">
<h3> class="title">1.3 for문을 이용해서 1부터 100까지 출력하세요!(짝수, 홀수)</h3>
<div class="code">
<pre><code> class="line-numbers language-js">v
</code></pre>
</div>
<div class="result">
<details>
<summary>결과 보기</summary>
<div> class="sample01_result">
</div>
</details>
</div>
</div>
<div class="test_box">
<h3> class="title">1.1 for문을 이용해서 1부터 100까지의 합을 출력하세요!</h3>
<div class="code">
<pre><code> class="line-numbers language-js">{
let sum = 0;
for(let i=1; i<=100; i++){
// sum = sum + i;
sum += i;
}
document.write(sum);
}
</code></pre>
</div>
<div class="result">
<details>
<summary>결과 보기</summary>
<div> class="sample01_result">
<script>>
let sum = 0;
for(let i=1; i<=100; i++){
sum = sum + i;
}
document.write(sum);
</script>
</div>
</details>
</div>
</div>
</div>
</main>