Command-Line program find the Largest number

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

Command-Line program  find the Largest number

Program to demonstrate Command-Line to find Largest number.

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 java program to create a window using swing.

About Ashishkumar Vishwakarma

I am Ashish- a Developer live in Mumbai.

View all posts by Ashishkumar Vishwakarma →

Leave a Reply

Your email address will not be published. Required fields are marked *