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 are the uses of c++ in the real world?
Differentiate between realloc() and free().
Define virtual constructor.
Is it possible to get the source code back from binary file?
What is abstract keyword in c++?
What is the basic structure of a c++ program?
How do you save a c++ program?
What does it mean to declare a destructor as static?
What is the use of seekg in c++?
What is the difference between prefix and postfix versions of operator++()?
What is cout flush?
List the advantages of inheritance.
give me an example for testing a program showing the test path .show how the test is important and complex.
Can we get the value of ios format flags?
How is computer programming useful in real life?