Pointers in C

  • + 0 comments

    This one can also be the simple one

    include

    void update(int *a,int *b) { int temp; temp = *a; *a = *a + *b; if(temp>*b) { *b = temp - *b; } else { *b = *b - temp; } // return *a; // return *b; // Complete this function
    }

    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;
    

    }