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

Explain do array subscripts always start with zero?

1222


What are examples of structures?

1097


What are # preprocessor operator in c?

1101


How do c compilers work?

1120


Explain data types & how many data types supported by c?

1081


What is d scanf?

1078


Is c is a low level language?

1128


What are identifiers and keywords in c?

1093


Can a pointer be volatile in c?

979


What is wrong in this statement?

1140


Explain what is dynamic data structure?

1158


What is merge sort in c?

1043


How can a string be converted to a number?

1019


What are types of preprocessor in c?

1066


find the sum of two matrices and WAP for it.

1131