Latest News: Java Program to Check Even or Odd Number - Java Code to Find Even or Odd Number

Java Program to Check Even or Odd Number - Java Code to Find Even or Odd Number

 Java Program to Check Even or Odd Number - Java Code to Find Even or Odd Number



import java.util.Scanner;

class EvenOdd
{
  public static void main(String args[])
  {
    int n;
    System.out.println("Enter an Integer number:");

    
    Scanner input = new Scanner(System.in);
    n = input.nextInt();

   
    if ( n % 2 == 0 )
        System.out.println("Entered number is even");
     else
        System.out.println("Entered number is odd");
  }
}



Popular Posts

MyMarket