Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

even and odd java &

import java.util.Scanner;

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

   
    Scanner in = new Scanner(System.in);
    num = in.nextInt();

   
    if ( (num & 1)= 1 )
        System.out.println("Entered number is odd");
     else
        System.out.println("Entered number is even");
  }
}
 
PREVIOUS NEXT
Tagged: #odd #java
ADD COMMENT
Topic
Name
6+4 =