Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to swap two strings without using any third variable ?

Answer Posted / santosh panigrahy

int main()
{
char *a = "hello";
char *b = "world";
a = a + (a-b);
b = a - (a-b)/2;
a = a - (a-b)*2;
printf(" a = %s b = %s ",a,b);
return 0;
}

Is This Answer Correct ?    26 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe the process of creation and destruction of a derived class object?

1086


What are the different types of comments allowed in c++?

949


Can a program run without main function?

1107


Explain unexpected() function?

1060


What is #include iostream h in c++?

1114


What problems might the following macro bring to the application?

997


What is functions syntax in c++?

1092


What is low level language in simple words?

1000


Can you pass a vector to a function?

933


What is c++ coding?

1149


What is c++ stringstream?

1066


Can non graphic characters be used and processed in C++?

1160


What is lvalue?

1144


What is cin clear () in c++?

1162


What is c++ try block?

1008