Write a java program to check a number is ever or odd


 Here is a java program which check the given number is even number or odd number. We insert a number through keyboard and see the result as a Even or Odd number.

public class checkEvenOld
{
public static void main(String as[])
{
int a=Integer.parseInt(as[0]);
System.out.println("ODD numbers are:-------");
for(int i=0;i<=a;i++)
{
if(i%2!=0)
{
System.out.println(i);
}
}
System.out.println("EVEN numbers are:------");
for(int i=0;i<=a;i++)
{
if(i%2==0)
{
System.out.println(i);
}     
 }
}       
}