could not figure out!! the a sample test case failed!
#include <stdio.h> void update(int *a,int *b) { // Complete this function if (*a > *b) { *a = *a + *b; *b = (*a - *b) - *b; } else *a = *a + *b; *b = *b - (*a - *b); } 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; } The above one is the code.. one of the same test case is two inputs "3514 2122" and the expected output is "5636 1392" but my output is "5636 -2852" the problem statement is "You have to complete the function void update(int *a,int *b), which reads two integers as argument, and sets 'a' with the sum of them, and 'b' with the absolute difference of them." input is handled automatically.