Write a program to swap 2 chars without using a third
varable?
char *s = "A";
char *p = "B";

Answer Posted / s.divya

void swap(A,B)
{
A=*p;
B=*s;
getch();
}

Is This Answer Correct ?    1 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of using pointers in a program?

689


How is static data member similar to a global variable?

603


When does the c++ compiler create temporary variables?

584


What are the effects after calling the delete this operator ?

572


What are the uses of static class data?

649






What do you mean by early binding?

609


Explain what are the sizes and ranges of the basic c++ data types?

656


What will the line of code below print out and why?

338


Why c++ is the best language?

600


What is class syntax c++?

611


What is a forward referencing and when should it be used?

589


What is a string example?

569


How are virtual functions implemented in c++?

613


What are the steps in the development cycle?

625


Why we use #include iostream in c++?

594