Write a JavaScript program to print even or odd number.
Answers
Answered by
1
Example 1: Using if...else
Enter a number: 27 The number is odd. In the above program, number % 2 == 0 checks whether the number is even. If the remainder is 0, the number is even. In this case, 27 % 2 equals to 1.
Similar questions
Environmental Sciences,
25 days ago
English,
25 days ago
Math,
1 month ago
English,
8 months ago
Social Sciences,
8 months ago
Physics,
8 months ago