Basics_Que_02

Home / Java Practice Question / Basics_Que_02

Basics_Que_02


WAP to swap two Number without Using  3rd Variable....

Program : 

public class Basics{
public static void swap(int a , int b){

a=a+b;
b=a-b;
a=a-b;

System.out.println("Value of a is : " + a);
System.out.println("Value of b is : " + b);
}

}