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 ");
}
}
}
0 comments:
Post a Comment