Program to demonstrate Command-Line to find Largest number.

This article explains, Program to demonstrate Command-Line to find Largest number.

Program to demonstrate Command-Line to find Largest number.

Also, you can use the Java compiler to compile a program.

SOURCE CODE  .

class cmd
{
	public static void main(String args[])
	{
		int a,b;
		System.out.println("largest number: ");
		a=Integer.parseInt(args[0]);
		b=Integer.parseInt(args[1]);
		if(a>b)
		System.out.println("a is Greater :" +a);
		else
		System.out.println("b is Greater:" +b);
	}
}

OUTPUT.

C:\A>javac cmd.java
C:\A>java cmd 12 34
largest number:
b is Greater:34

Also View: – Write a program to create a registration form using AWT.

Also View- Write a java program to create a window using swing.

Ashishkumar Vishwakarma

I am Ashish- a Developer and Artist live in Mumbai.

Leave a Reply