Java Examples
Java ExamplesPrograms with output

Java Program to Check The Number is Even or Odd


Example:
import java.util.Scanner;

public class CheckEvenOdd
{
    public static void main(String args[])
    {
        int num;
        Scanner scan = new Scanner(System.in);
		
        System.out.println("Enter any Number: ");
        num = scan.nextInt();
		
        if(num%2 == 0)
        {
            System.out.println("It is Even Number");
        }
        else
        {
            System.out.println("It is Odd Number");
        }
    }
}
Output:
Enter any Number:
15
It is Odd Number

Share this page on:

Was this page helpful ?

Let us know how we did!

Subscribe Email Updates

to get latest update