Code Box
-----------------------------------------
/* Program to print greater number in 2 numbers using
if else in command line argument */
class greaterif
{
public static void main(String x[])
{
int a,b;
a=Integer.parseInt(x[0]);
b=Integer.parseInt(x[1]);
if(a>b)
{
System.out.print("\n a is greater a="+a);
}
else
{
System.out.print("\n b is greater b="+b);
}
}
}
0 comments:
Post a Comment