Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a program to swap Two numbers without using temp variable.

Answer Posted / dhruv

I am not giving an answer, but just wanted to point out that
most of the solutions which try to add (a+b) and then
subtract from it will not work if (a+b) exceeds the maximum
value an int can hold.

So even if it looks good on paper it will give erroneous
results when run on a machine

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;

1835


What is variable initialization and why is it important?

1267


Differentiate between full, complete & perfect binary trees.

1109


Explain what math functions are available for integers? For floating point?

1116


When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?

1071


How do I use strcmp?

1080


What is array of structure in c programming?

1291


What is wrong with this code?

1188


Explain the difference between malloc() and calloc() function?

1057


console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above

1179


What is chain pointer in c?

1061


writ a program to compare using strcmp VIVA and viva with its output.

2024


What is union in c?

1119


Tell us the use of fflush() function in c language?

1146


Explain how do you view the path?

1178