Write a Java Program to Check Whether the entered number is Even or Odd.
Q.9 Write a Java Program to Check Whether the entered number is Even or Odd.
Solution :-Â
import java.util.*;
class even_odd Â
{
   public static void main(String args[])
   {
      int no1;Â
      Scanner out = new Scanner(System.in);
      System.out.println(“Enter the first number :- “);
      no1 = out.nextInt();
      if(no1 % 2 == 0)
      {
         System.out.println(“It is Even number :- “+no1);
      }
      else
      {
         System.out.println(“It is Odd number :- “+no1);  Â
      }
   }
}Â
Solution :-Â