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

What will be the outcome of the following conditional statement if the value of variable s is 10?

1303


What are the advantages of c language?

1099


What are the types of variables in c?

1025


What is FIFO?

1746


Can we declare a function inside a function in c?

1048


Explain how do you view the path?

1183


What does c mean in standard form?

1188


What are structures and unions? State differencves between them.

1188


code for quick sort?

2046


What is difference between static and global variable in c?

1066


Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me

1955


What is a program flowchart?

1215


write a program to find out prime number using sieve case?

2105


Explain 'far' and 'near' pointers in c.

1150


Is array a primitive data type in c?

1081