import java.util.Scanner;
Class EvenOdd
{
public static void main(String ...args)
{
Scanner sc=new Scanner(System.in);
int a=sc.nextInt();
String s[]={"odd","even"};
int n=a%2;
System.out.println(a+"is a"+string[n]);
}
}
2nd way
import java.util.*;
class test
{
Scanner sc=new Scanner(System.in);
System.out.println("enter any number");
int n=sc.nextInt();
int k=n;
void myfun()
{
try
{
n=n%2;
k=k/n;
System.out.println(k+"is odd number");
}
catch(ArithmeticException ae)
{
System.out.println(k+"is even number");
}
}
public static void main(String ...nani)
{
test t=new test();
t.myfun();
}
}