Java Program To Check Input Number Is Even Or Odd

      No Comments on Java Program To Check Input Number Is Even Or Odd
import java.util.Scanner;
class scan 
{
 public static void main(String arg[])
{
 int num;
 Scanner kb=new Scanner(System.in);
 System.out.println("Enter Number");
  num=kb.nextInt();
if(num%2==0)
 {
   System.out.println("Number Is Even");
 }
else
 {
   System.out.println("Number Is Odd");
 }
}
}

OUTPUT 1:-

Enter Number
68
Number Is Even

OUTPUT 2:-

Enter Number
97
Number Is Odd

Leave a Reply

Your email address will not be published. Required fields are marked *