adplus-dvertising
frame-decoration

Question

If s and b are integers then  purpose of the following program fragment is to 

   b = s + b ;
   s = b - s ;
   b = b - s ;

a.

transfer the contents of s to b

b.

transfer the content of b to s

c.

exchange (swap) the contents of s and b

d.

negate the contents of s and b

Posted under C Programming

Answer: (c).exchange (swap) the contents of s and b

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. If s and b are integers then  purpose of the following program fragment is to     b = s + b ;    s = b - s ;    b = b - s ;