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?

Answers were Sorted based on User's Feedback



How to swap 3 numbers without using 4th variable?..

Answer / sundar

a=a+b+c
b=a-(b+c)
c=a-(b+c)
a=a-(b+c)

Is This Answer Correct ?    89 Yes 13 No

How to swap 3 numbers without using 4th variable?..

Answer / pallavi dhanopiya

a=a*b*c;
b=a/b/c;
c=a/b/c;
a=a/b/c;

Is This Answer Correct ?    12 Yes 3 No

How to swap 3 numbers without using 4th variable?..

Answer / 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

How to swap 3 numbers without using 4th variable?..

Answer / mujamil

how to swap of 4number

Is This Answer Correct ?    3 Yes 1 No

How to swap 3 numbers without using 4th variable?..

Answer / pavan

a=(a+b+c)-(b=a)-(c=b)

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More C Interview Questions

Explain how do you print an address?

0 Answers  


explain what is a newline escape sequence?

0 Answers  


Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.

0 Answers  


who is the founder of c

19 Answers   College School Exams Tests, HP,


Subtract Two Number Without Using Subtraction Operator

0 Answers  


write a addition of two no. program with out using printf,scanf,puts .

4 Answers  


What does node * mean?

0 Answers  


Explain what standard functions are available to manipulate strings?

0 Answers  


How do you initialize function pointers? Give an example?

3 Answers  


main() { printf("hello"); fork(); }

0 Answers   Wilco,


how to exchnage bits in a byte b7<-->b0 b6<-->b1 b5<-->b2 b4<-->b3 please mail me the code if any one know to rajeshmb4u@gmail.com

3 Answers   Honeywell, Huawei,


print the table 5 in loops

3 Answers  


Categories