how to swap two numbers with out using temp variable
Answer Posted / guest
another way is using bitwise XOR (^).
a=9; //a=1001
b=5; //b=0101
a=a^b; //a=1100
b=a^b; //b=1001
a=b^a; //a=0101
| Is This Answer Correct ? | 29 Yes | 6 No |
Post New Answer View All Answers
Describe the setting up of my member functions to avoid overriding by the derived class?
What is endl?
What is type of 'this' pointer?
What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?
Can a Structure contain a Pointer to itself?
Can a built-in function be recursive?
What is a stack? How it can be implemented?
What is a dynamic binding in c++?
How does the copy constructor differ from the assignment operator (=)?
How do you clear a map in c++?
What is polymorphism and its type in c++?
Difference between declaration and definition of a variable.
What is the keyword auto for?
Difference between class and structure.
What is boyce codd normal form in c++?