class Swap
{
public static void main(String…s)
{
int a,b;
a=Integer.parseInt(s[0]);
b=Integer.parseInt(s[1]);
System.out.println(“nBefore Swap:n”+”a=”+a+”tb=”+b);
a=a+b;
b=a-b;
a=a-b;
System.out.println(“nAfter Swap:n”+”a=”+a+”tb=”+b);
}
}
Output
class Swap
{
public static void main(String…s)
{
int a,b;
a=Integer.parseInt(s[0]);
b=Integer.parseInt(s[1]);
System.out.println(“nBefore Swap:n”+”a=”+a+”tb=”+b);
a=a+b;
b=a-b;
a=a-b;
System.out.println(“nAfter Swap:n”+”a=”+a+”tb=”+b);
}
}
Output