Why Subtraction is allowed? Two addresses can be subtracted because the memory between the two addresses will be valid memory. For example - Pointer ptr_1 is pointing to 0x1cb0010 memory location and ptr_2 is pointing to 0x1cb0030 memory location. If we subract ptr_1 from ptr_2, then the Memory region will lie in between these two location which is obviously a valid memory location.
Why addition, Multiplication or division is not allowed??
If we perform addition, multiplication or division on ptr_1 and ptr_2, then the resultant address may or may not be a valid address. That can be out of range or invalid address. This is the reason compiler doesn’t allow these operations on valid addresses.