how to swap two strings without using any third variable ?

Answer Posted / kollu.praveen

var1="String1"
var2="String2"
var1=var1+var2
var2=mid(var1,1,Len(var1)-Len(var2))
print var2
var1=mid(var1,(Len(var1)-Len(var2)+1),(Len(var2)+1))
print var1

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is class and structure in c++?

548


What are the stages in the development cycle?

568


Is dev c++ a good compiler?

516


Tell me can a pure virtual function have an implementation?

548


What is the default width for ouputting a long integer using the insertion operator?

681






Explain data encapsulation?

599


What is friend class in c++ with example?

494


Explain the difference between using macro and inline functions?

572


What are the uses of c++ in the real world?

554


Where the memory to the static variables is allocated?

550


What data encapsulation is in c++?

587


Define vptr.

586


What are the different types of polymorphism in c++?

581


What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?

607


What is the use of 'this' pointer?

761