how to swap two strings without using any third variable ?

Answer Posted / ashutosh

say a = 10 and b = 20;
b = a + b;// b= 30
a = b - a;// a= 20
b = b - a;// b= 10

so now a = 20 b= 10

Is This Answer Correct ?    27 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain unexpected() function?

578


What are the classes in c++?

632


what is multi-threading in C++?

605


Difference between pointer to constant and constant pointer to a constant. Give example.

630


What can c++ be used for?

578






Can you be bale to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

554


Why do we learn c++?

523


In the derived class, which data member of the base class are visible?

633


What is algorithm in c++ programming?

583


What are the implicit member functions of class?

591


What is a class template in c++?

513


How do you declare A pointer to function which receives an int pointer and returns a float pointer

670


What are the advantages of early binding?

602


What are the two types of comments?

566


Explain virtual destructor?

664