Computer Science, asked by a1veshchaudhari, 3 months ago

Write a program in javascript to find the number is even or odd.​

Answers

Answered by thilakkumarsivakumar
0

Answer:

// 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.");

}

Output

Enter a number: 27

The number is odd.

Similar questions