How to swap 3 numbers without using 4th variable?
Answers were Sorted based on User's Feedback
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 |
What is the difference between c &c++?
Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.
What is the equivalent code of the following statement in WHILE LOOP format?
What are integer variable, floating-point variable and character variable?
Can a file other than a .h file be included with #include?
What are keywords in c with examples?
Is a house a shell structure?
Is c an object oriented programming language?
What is the purpose of macro in C language?
What is malloc and calloc?
Difference between strcpy() and memcpy() function?
What is sizeof array in c?