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

How do we swap or interchange any 2 numbers without using
Temporary variable...Anybody can pls answer it.. Thanks in
Advance

Answer Posted / srikanth

int x,y;

x =x-y;
y =y+x;
x =y-x;

or

int x,y;

x=x^y;
y=x^y;
x=x^y;

or

int x,y;
x*=xy;
y=x/y;
x=x/y;

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

The difference between printf and fprintf is ?

1263


show how link list can be used to repersent the following polynomial i) 5x+2

2273


What is a macro?

1087


What is the use of getch ()?

1061


What are the advantages of using linked list for tree construction?

1064


How pointers are declared?

942


Why clrscr is used in c?

1000


Can you assign a different address to an array tag?

1153


what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?

1849


What is c method?

981


What is the use of linkage in c language?

1042


Explain what are bus errors, memory faults, and core dumps?

1262


What is the symbol indicated the c-preprocessor?

1222


Explain about the constants which help in debugging?

1351


Is c object oriented?

956