• [deleted]
    + 0 comments

    using cmath lib

    #include <stdio.h>
    #include <cmath>
    
    using namespace std;
    void update(int *a,int *b) {
        // Complete this function 
        int temp,noAbs;
        temp = *a;
        noAbs = temp - (*b);
        *a = *a + *b;
        *b = abs(noAbs);     
    }
    
    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;
    }