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

12,952,725 members (37,320 online)

Email

Password

Sign in with