Sunday 22 September 2013

Difference between two numbers

PROGRAM CODING:

class Subtraction
{
public static void main(String args[])
{
int a=Integer.parseInt(args[0]);
int b=Integer.parseInt(args[1]);
int c;
c=a-b;
System.out.println("The Difference between two value is"+c);
}
}

OUTPUT:

C:\Program Files (x86)\Java\jdk1.7.0_25\bin\Lokey>javac Subtraction.java
C:\Program Files (x86)\Java\jdk1.7.0_25\bin\Lokey>java Subtraction 10 8
The Difference between two value is 2

No comments:

Post a Comment