Standard Swap problem

pub­lic class Swap­Vari­ables
{
pub­lic sta­t­ic void main(String args[])
{
int a=5;
int b= 6;

System.out.println(“Before Swap :”+a+” “+b);

a=a+b;
b=a‑b;
a=a‑b;

System.out.println(“After Swap :”+a+” “+b);

}
}

Categories:

Tags:

Leave a Reply

%d bloggers like this: