If this procedure is called with xp equal to yp (i.e. both xp and yp point to the same integer) what effect will it have compared to the situation where xp and yp point to different integers?

Respuesta :

Answer:

The value is always zero .

Explanation:

If both have different values

a = 10, b = 20

As

xp = xp+yp so

xp = 30

yp =20

As

yp = xp-yp

so xp=30

yp=10

Now

xp = xp-yp = 20

so we can conclude that both a and b have been interchanged.

if both direct to same object

then

xp = xp+yp

so xp = 40

yp =40

Now

yp = xp-yp

so xp=0

yp=0

and

xp = xp-yp = 20