#include 《iostream》
using namespace std;
int main()
{
int a = 1;
int b = 2;
//before switch
cout<< a<<endl;
cout<<b<<endl;
a = a+b;
b = a-b; //this becomes b = a+b-b = 3-2 = 1
a = a-b; // this becomes a = a+b-a = 3 - 1 = 2
cout<<"After switch..."<<endl;
//after switch
cout<< a<<endl;
cout<<b<< endl;
return 0;
}

Quite confusing right? 😃