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 |
Why is c called "mother" language?
What is the return type of sizeof?
how do you redirect stdout value from a program to a file?
main() { char *p1="Name"; char *p2; p2=(char *)malloc(20); while(*p2++=*p1++); printf("%s\n",p2); }
64/square(4)
what is the purpose of the code, and is there any problem with the code? int f( int n, int l, int r ) { return (n << l) >> r; }
What is the use of ?: Operator?
What is c language used for?
Define function pointers?
Can we compile a program without main() function?
Concat two string with most overlapped substring has to removeĀ "abcd"+ "cdef" = "abcdef
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year