int a=20, b=30;

// before swapping values are a= 20 and b=30

a = a+b ; // now a = 50 and b= 30

b = a-b; // now a = 50 and b = 20

a = a-b; // now a = 30 and b= 20

// after swapping values are a= 30 and b = 20

11,433,220 members (59,909 online)

Email

Password

Sign in using