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

What is equivalent to ++i+++j?

1101


Is array a primitive data type in c?

1082


What is use of integral promotions in c?

1157


How can I recover the file name given an open stream?

1035


What are type modifiers in c?

1061


How are pointers declared in c?

1072


Is fortran still used today?

1101


In C language what is a 'dangling pointer'?

1172


List the difference between a While & Do While loops?

1116


What are the advantages and disadvantages of a heap?

1218


what is the diffrenet bettwen HTTP and internet protocol

1844


What is the purpose of the preprocessor directive error?

1279


Explain the red-black trees?

1141


What is the function of this pointer?

1354


Which function in C can be used to append a string to another string?

1226