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...


this is to swap to strings....but in output the whole
strings are swapped leaving first as it is...why it is so

#include<iostream.h>
int main()
{
char a[]="ajeet";
char b[]="singh";
long x=*a;
long y=*b;
cout<<x<<":"<<y;
x=x+y;
y=x-y;
x=x-y;
*a=x;
*b=y;
cout<<x<<":"<<y;
cout<<&a<<endl;
cout<<&b<<endl;
}



this is to swap to strings....but in output the whole strings are swapped leaving first as it is.....

Answer / sachin chakote

only first letter will be swapped

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

What is using namespace std in cpp?

0 Answers  


Why c++ is better than c language?

0 Answers  


What is a class definition?

0 Answers  


What is the difference between map and hashmap in c++?

0 Answers  


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

0 Answers  


Explain queue. How it can be implemented?

0 Answers  


What is buffer and example?

0 Answers  


Difference between struct and class in terms of access modifier.

0 Answers  


What are the various access specifiers in c++?

0 Answers  


Which software is used for c++ programming?

0 Answers  


Show the declaration for a static member variable.

0 Answers  


What is the insertion operator and what does it do?

0 Answers  


Categories