void update(int *a,int *b) {
*a=*a+*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;
}
i wanted to store the sum of a & b in a and diff. of a & b in b using pointers pointing towards a & b,so i tried it in the way given,the addition part is working fine bt i don't know why subtraction is not working??