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;
}
Answer Posted / sachin chakote
only first letter will be swapped
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What do you understand by a pure virtual member function?
What return value must conversion operators have in their declaration?
What do you mean by delegate? Can a user retain delegates?
what kind of projects are suitable for c and c++
Where are setjmp and longjmp used in c++?
What are the advantages of using typedef in a program?
What does floor mean in c++?
In a function declaration, what does extern mean?
How the endl and setw manipulator works?
What are maps in c++?
What is a flag in c++?
What is the purpose of template?
What is an adaptor class or wrapper class in c++?
What's c++ used for?
What is extern c++?