How to swap value without using Temporary Variable ?
Interview question and answer by:
Ajay.Kalol | Posted on: 5/8/2012 | Category:
Others Interview questions | Views: 698 | |
Points: 40
Answer:
X = 10 Y = 2
X = X + Y; (10 + 2 = 12)
Y = X - Y; (12 - 2 = 10)
X = X - Y; (12 - 10 = 2 )
After this X = 2 AND Y = 10
Asked In: My Interviews
|
Alert Moderator
Found interesting? Add this to: