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
How many keywords are used in c++?
What are shallow and deep copy?
What is a syntax in c++?
Can you please explain the difference between static and dynamic binding of functions?
the first character in the variable name must be an a) special symbol b) number c) alphabet
How do you establish a has-a relationship?
Write about the stack unwinding?
Can there be at least some solution to determine the number of arguments passed to a variable argument list function?
What is abstraction in c++?
Is dev c++ free?
What is == in programming?
What is a far pointer? where we use it?
Which compiler does turbo c++ use?
Can you help me with this one? Make a program that when a user inputed a Product Name, it will display its price, and when the user inputed the quantity of the inputed product, it will show its total price. The output must be like this: Product Name: Price: Quantity: Total Price: ..this is the list of products to be inputed: Cellphone - 1500 Washing Machine - 5200 Television - 6000 Refrigirator - 8000 Oven - 2000 Computer - 11000 thanks..:D
What is the use of ::(scope resolution operator)?