JS a determined integer is even or odd, and outputs the judgment result.

<script>
var num2 = prompt ( "Enter a number");
num2 = + num2;
if (num2 % 2 === 0){
the console.log ( "the number is an even number");
} else if (num2 % 2 === 1){
the console.log ( "this number is odd");
}
</script>

Guess you like

Origin www.cnblogs.com/zz22/p/11402141.html