How to swap 2 integers without using a third variable such that it works for all ranges of integers. I know that generally we do the following logic.
        int a, b;
        a = 10;
        b = 30;
        a = a + b;
        b = a - b;
        a = a - b;
But this logic will fail if (a + b) gives the value more than the integer range. Is there any other logic?
 
     
     
     
    