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

Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).

642


Differentiate between an external iterator and an internal iterator?

578


Write a C++ Program to check whether a number is prime number or not?

642


Can I learn c++ without c?

613


How long it will take to learn c++?

622






What is c++ array?

562


When do we run a shell in the unix system?

573


What does ctime() do?

620


What do you mean by public protected and private in c++?

609


Is c++ the hardest language?

575


In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h

688


Should the this pointer can be used in the constructor?

563


You run a shell on unix system. How would you tell which shell are you running?

667


Write about the local class and mention its use?

621


Explain the term memory alignment?

696