Preview:
#include <stdio.h>

void update(int *a,int *b) {
     
    
    int ans = *a; 
    *a = *a + *b;
    *b = ans - *b; 
    if (*b <0){
        *b = -(*b);
    }
    
    //printf("*pb %d\n", *pb);
    //printf("*a %d\n",*a);
    //printf("*b %d\n",*b);
    //printf("*pa %d\n",*pa);
    //printf("\n"); 
    //    
}

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;
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter