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

WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..

2004


Where does the name "C" come from, anyway?

1110


Why c is a mother language?

991


What is the significance of scope resolution operator?

1379


what is different between auto and local static? why should we use local static?

1094


Write a program to print "hello world" without using a semicolon?

1033


What is array of structure in c?

1128


Does free set pointer to null?

971


c program to compute AREA under integral

2365


What are the restrictions of a modulus operator?

1084


What is structure in c language?

1125


What are the different types of pointers used in c language?

1019


Are the expressions * ptr ++ and ++ * ptr same?

1106


What is a string?

1073


How can I make it pause before closing the program output window?

1008