Computer Science, asked by Usaidshaikh, 2 months ago

Write a JavaScript program to print even or odd number.​

Answers

Answered by rajansh9796
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