Java Program to Check Even or Odd Number

Here you will get java program to check even or odd number.

How to check?

If number is completely divisible by 2 then it is even otherwise odd.

In our program we will find the remainder of number by dividing it by 2 using modulus (%) operator. If remainder is 0 then number is even else odd.

Java Program to Check Even or Odd Number

 

Output

Enter a number:
4
even number

Leave a Reply

Your email address will not be published. Required fields are marked *