• + 0 comments

    Using Ternary Operator

    void update(int *a,int *b) {
        int x=*a + *b;
        int diff=*a-*b;
        int y=(diff<0 ? -diff : diff;
        *a=x;
        *b=y;
    }