Showing posts with label even or odd. Show all posts
Showing posts with label even or odd. Show all posts

Sunday, November 2, 2014

, , , ,

Program to print given number is even or odd numbers using if else in command line argument.




Code Box 
-----------------------------------

/* Program to print given number is even or odd numbers using 
if else in command line argument */


class even
{
public static void main(String x[])
{
int a;

a=Integer.parseInt(x[0]);

if(a%2==0)
{
System.out.print("\n a is Even ");
}
else
{
System.out.print("\n a is Odd ");
}

}

}
Publisher: Brijmohan Lal Sahu - 3:38 AM