• + 0 comments
    #include <stdio.h>
    
    void update(int *a,int *b) {
        // Complete this function 
        
        int sum = *a + *b;
        int value = *a - *b;
        int absValue;
        
        if (value < 0){
            absValue = -value;
        } else {
            absValue = value;
        }
        *a = sum;
        *b = absValue;
    
    }
    
    int main() {
        int a, b;
        int *pa = &a, *pb = &b;
        
        scanf("%d %d", &a, &b);
        update(pa, pb);
        printf("%d\n%d", a, b);
    
        return 0;
    }