check if even or odd javascript
function evenOrOdd(num) { //for string length take string
if (num % 2 == 0) {//and replace numm with string.length here
return "even";
} else {
return "odd";
}
}
check if even or odd javascript
function evenOrOdd(num) { //for string length take string
if (num % 2 == 0) {//and replace numm with string.length here
return "even";
} else {
return "odd";
}
}
if odd js
function isEven(value) {
return !(value % 2)
}
odd or even js
for(let count =0; count<=100;count++){
count%2==0? console.log(`${count} is even`):console.log(`${count} is odd`);
;
}
javascript check if a number is even or odd
const isEven = num => num % 2 === 0;
console.log(isEven(2));
// Result: True
javascript program check the number even or odd
<!doctype html>
<html>
<head>
<script>
function odd_even(){
var no;
no=Number(document.getElementById("no_input").value);
if(no%2==0)
{
alert("Even Number");
}
else
{
alert("Odd Number");
}
}
</script>
</head>
<body>
Enter Any Number:<input id="no_input"><br />
<button onclick="odd_even()">Click me</button>
</body>
</html>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us