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
Explain what are accessor methods?
Explain overriding.
What is c++ vb?
Am studying basic c++ programming, have been given the following assignment. Design a linear program to calculate the maximum stress a material can withstand given a force and a diameter of a circle. To find the required area pi should be defined. Have most of the program sorted out but am at a loss as to how to show the calculations required. Can anyone help?
What are the uses of pointers?
What is singleton pattern in c++?
What is a manipulator in c++?
What is auto type c++?
What are c++ manipulators?
Give an example of run-time polymorphism/virtual functions.
What is namespace std; and what is consists of?
What is the best it certification?
What is c++ iterator?
What is the basic of c++?
What does new return if there is insufficient memory to make your new object?