How do we swap or interchange any 2 numbers without using
Temporary variable...Anybody can pls answer it.. Thanks in
Advance
Answer Posted / emperor of america
using bitwise operator works 100%:
x^=y;
y^=x;
x^=y;
using +/- works sometime, need to consider overflow.
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What is the purpose of the preprocessor directive error?
What is substring in c?
When is a “switch” statement preferable over an “if” statement?
code for quick sort?
Explain the difference between exit() and _exit() function?
What are data structures in c and how to use them?
What is the importance of c in your views?
What are the 4 data types?
What is the difference between declaring a variable and defining a variable?
What are c preprocessors?
What is the best way to store flag values in a program?
Where is volatile variable stored?
Is there anything like an ifdef for typedefs?
What does stand for?
Which is better between malloc and calloc?