```
int main()
{
int *x;
int *y;
x * y;
x - y;
x + y;
}
```

In the above program we see the error at x*y and x+y not on the x-y. Please explain?

+1 vote

```
int main()
{
int *x;
int *y;
x * y;
x - y;
x + y;
}
```

In the above program we see the error at x*y and x+y not on the x-y. Please explain?

+1 vote

0 votes

I believe your query is why it is kept in these way -

Addition or multiplication of two pointers generates a very bug number (pointer) which most likely may be out of the function space so it is kept invalid. While this is not true in case of subtraction and it tell the distance between two pointers which is a meaningful information (not true with division).

...

2. Multiplication of two pointers/one pointer and one variable(int/float etc) is also invalid.