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...

swap two integer variables without using a third temporary
variable?

Answer Posted / sumit salve

a=a+b-(b=a);
or
a=a*b/(b=a);
this will also swap two numbers!!!

Thank You...

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is return type in c?

1131


What is the difference between local variable and global variable in c?

1227


a program that can input number of records and can view it again the record

1906


What does %p mean?

1083


in linking some of os executables are linking name some of them

2126


What is the concatenation operator?

1147


Explain is it better to bitshift a value than to multiply by 2?

1196


What is meant by 'bit masking'?

1386


What is difference between structure and union?

1124


What is mean by data types in c?

1027


What are global variables and explain how do you declare them?

1096


Explain how can I make sure that my program is the only one accessing a file?

1218


Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

1274


What is the use of linkage in c language?

1055


What will be your course of action for a push operation?

1109