how to swap two numbers with out using temp variable

Answer Posted / prasannaroy

a=10;
b=20;
b=a+b-(a=b);

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we make copy constructor private in c++?

591


What are disadvantages of pointers?

561


Explain deep copy?

602


If horse and bird inherit virtual public from animal, do their constructors initialize the animal constructor? If pegasus inherits from both horse and bird, how does it initialize animal’s constructor?

634


Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers

606






What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator?

630


What is the best free c++ compiler for windows?

586


What are the extraction and insertion operators in c++? Explain with examples.

635


How are Structure passing and returning implemented by the compiler?

593


What are the unique features of C++.

567


Write about c++ storage classes?

740


How do we balance an AVL Tree in C++?

628


What new()is different from malloc()?

565


Explain how to initialize a const data member.

589


How can I learn c++ easily?

616