Skip to content

Instantly share code, notes, and snippets.

@Kkan9ma
Created July 2, 2019 07:09
Show Gist options
  • Save Kkan9ma/89ff219e41949a05e91c18c11d36aa24 to your computer and use it in GitHub Desktop.
Save Kkan9ma/89ff219e41949a05e91c18c11d36aa24 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
</head>
<body>
<h2>조건문 연습 1</h2>
<script>
var a = prompt("숫자를 입력하세요");
var num = Number(a);
if (a % 2 === 0) {
console.log("짝수입니다.");
}
else {
console.log("홀수입니다.");
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment