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 to swap 3 numbers without using 4th variable?

Answer Posted / ilana

The target is a<-b b<-c c<- a
------------------------------------
a = a+b+c ; // a+b+c b c
c = c+b; // a+b+c b b+c
b = c-b; // a+b+c c b+c
c = a-c; // a+b+c c a
a = a-(b+c) // b c a

Is This Answer Correct ?    12 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Wt are the Buses in C Language

3152


Why enum is used in c?

898


In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping

1419


write a programming in c to find the sum of all elements in an array through function.

2115


Explain the use of keyword 'register' with respect to variables.

969


please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com

1722


Lists the benefits of c programming language?

1067


What is the size of empty structure in c?

1018


What is zero based addressing?

1110


How many keywords (reserve words) are in c?

1083


Why is sprintf unsafe?

998


Explain what are compound statements?

994


What is exit() function?

965


What are the scope of static variables?

1117


What is variables in c?

984