java

Java Program to find Odd or Even number!

Let’s see an interesting program for school/college students who are learning core Java.

To find whether an entered number is Odd or Even is very simple, all you have to do is divide the number by 2 and if you get the remainder 0 (zero) then it is an Even number or it is an Odd number.

Eg: 10 / 2 = 5, here 5 is the quotient, 0 is the remainder.

In Java there are two operators you can use to find quotient and remainder. (/) slash and (%) modulus, where the / will give the quotient and % will give the remainder value. 

So here is the Java Program to find Odd or Even number!

Just read the comments in the above program to understand it.

Example Output of the above program:

Enjoy Learning!

Related Posts

Leave a Reply