```
int main(void)
{
    int n1 = 2, n2 = 5;
    int *p = &n1, *q = &n2;
    *p = *(q++);
    printf("%d,%d", *p, *q);
    return 0;
}

```

output= 5,5

Why the value of `*q` is 5 it should have some garbage value?

int main(void)

```
{

    int n1 = 2, n2 = 5;

    int *p = &n1, *q = &n2;

    *p = *(++q);

    printf("%d,%d", *p, *q);

    return 0;

}

```

output= 2,2

And how is this happening?
Can anyone explain how precedence rule works in pointers?