• + 0 comments

    You can do it with just one variable too.

    void update(int *a,int *b)

    { int temp = *a;

    *a = *a + *b;

    (*b > temp) ? *b = ( temp - b ) -1 : *b = temp - *b; }