how to swap two numbers with out using temp variable
Answer Posted / raja
if a=10& b=20
a=a+b //a=30
b=a-b //b=10
a=a-b //a=20
finally we got a=20,b=10
| Is This Answer Correct ? | 10 Yes | 3 No |
Post New Answer View All Answers
What is the identity function in c++? How is it useful?
Why pointer is used in c++?
What are friend classes? What are advantages of using friend classes?
What is the main function c++?
What are references in c++? What is a local reference?
What are the classes in c++?
How can an improvement in the quality of software be done by try/catch/throw?
What is the difference between set and map in c++?
write a function signature with various number of parameters.
How do you show the declaration of a virtual constructor?
What data encapsulation is in c++?
How to implement is-a and has-a class relationships?
What is the purpose of templates in c++?
Why c++ is created?
What do you mean by global variables?