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

why wipro wase

2313


any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above

1125


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

1514


List a few unconditional control statement in c.

988


Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)

1034


application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above

1068


Why do we use namespace feature?

1059


What is the explanation for cyclic nature of data types in c?

1217


Difference between pass by reference and pass by value?

1160


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

1106


How will you find a duplicate number in a array without negating the nos ?

2135


What will the code below print when it is executed?   int x = 3, y = 4;         if (x = 4)                 y = 5;         else                 y = 2;         printf ("x=%d, y=%d ",x,y);

1883


‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .

2881


Which function in C can be used to append a string to another string?

1222


What is the main difference between calloc () and malloc ()?

1156