write a program in java script to accept a number from the user and find whether the number is an ord number or even number display it in an alert box
plz answer otherwise I will report
Answers
Answered by
10
Explanation:
// program to check if the number is even or odd
// take input from the user
const number = prompt("Enter a number: ");
//check if the number is even
if(number % 2 == 0) {
console.log("The number is even.");
}
// if the number is odd
else {
console.log("The number is odd.");
}
Answered by
0
★PROGRAM TO CHECK IF THE NUMBER IS EVEN OR ODD.
★TAKE INPUT FROM THE USER
CONST NUMBER=PROMPT{"ENTER A NUMBER"}
★CHECK IF IT IS EVEN OR ODD
{LET THE NUMBER BE 7}
CONSOLE.LOG{"THE NUMBER IS ODD"}
HOPE IT HELPS YOU.
Similar questions
Geography,
28 days ago
Math,
28 days ago
Accountancy,
28 days ago
English,
1 month ago
Math,
9 months ago