How do we swap or interchange any 2 numbers without using
Temporary variable...Anybody can pls answer it.. Thanks in
Advance
Answer Posted / srikanth
int x,y;
x =x-y;
y =y+x;
x =y-x;
or
int x,y;
x=x^y;
y=x^y;
x=x^y;
or
int x,y;
x*=xy;
y=x/y;
x=x/y;
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What are header files and what are its uses in C programming?
Why do we use int main instead of void main in c?
How can I rethow can I return a sequence of random numbers which dont repeat at all?
What is the sizeof () operator?
What are the advantages and disadvantages of pointers?
Why is not a pointer null after calling free?
Where static variables are stored in c?
What are the 4 types of functions?
What is meant by inheritance?
Explain what is wrong with this program statement? Void = 10;
write a program to find the given number is prime or not
Do character constants represent numerical values?
What’s a signal? Explain what do I use signals for?
What does 3 periods mean in texting?
WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER