forked from shindalsoo-gmail/OpenSource
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path99dan.html
More file actions
36 lines (32 loc) · 905 Bytes
/
99dan.html
File metadata and controls
36 lines (32 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>구구단</title>
</head>
<body>
<script>
var num = prompt("출력할 구구단 숫자 입력", "1");
var i = 1;
// for 문
document.write("for 을 이용한 출력", "<br>");
for (i = 1; i < 10; i++) {
document.write(num + " * " + i + " = " + (num * i) + "<br>");
}
i = 1;
// while문
document.write("while을 이용한 출력", "<br>");
while (i < 10) {
document.write(num + " * " + i + " = " + (num * i) + "<br>");
i++;
}
i = 1;
// do-while 문
document.write("do-while을 이용한 출력", "<br>");
do {
document.write(num + " * " + i + " = " + (num * i) + "<br>");
i++;
} while (i < 10)
</script>
</body>
</html>