recent

Java program to find odd or even

Write a Java program to find odd or even | even odd program in java

/*java program to find the given number is even or odd */
import java.util.Scanner;

class EvenOrOdd
{
   public static void main(String args[])
   {
      int xi;
      System.out.println("Enter an integer number to check if it is even or odd ");
      Scanner in = new Scanner(System.in);
      i = in.nextInt();

      if ( i % 2 == 0 )
         System.out.println("Even number");
      else
         System.out.println("Odd number");
   }
}
Powered by Blogger.