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 / raghuram.a

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;

Is This Answer Correct ?    11 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how we can make 3d venturing graphics on outer interface

4849


What is c language used for?

1001


int far *near * p; means

3568


Explain what is a program flowchart and explain how does it help in writing a program?

1107


What is the best organizational structure?

1139


What is difference between && and & in c?

1123


What is the use of clrscr?

1122


What is the basic structure of c?

1102


State two uses of pointers in C?

1078


Is that possible to store 32768 in an int data type variable?

1096


What is memory leak in c?

1140


explain what is fifo?

1094


How do I use strcmp?

1091


What are register variables? What are the advantage of using register variables?

1195


Do you know the difference between malloc() and calloc() function?

1080