Pointers in C

  • + 0 comments
    void update(int *a,int *b) {
        // Complete this function
        int s, d;
        s = *a+*b;
        d = *a-*b;
            
        *a = s;
        *b = d;
        
        if (*b < 0) {
            *b = -(*b);
        }
    }