Swap two numbers without using third variable

PHOTO EMBED

Fri Dec 01 2023 05:27:45 GMT+0000 (Coordinated Universal Time)

Saved by @nistha_jnn #c++

 pair<int, int> get(int a, int b)
    {
        a=a+b;
        b=a-b;
        a=a-b;
        return{a,b};
    }
content_copyCOPY

https://www.geeksforgeeks.org/problems/swap-two-numbers3844/1?page=1&company=Samsung&sortBy=difficulty