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

Answer Posted / answer and question

k=*s;
*s=*p;
*p=k;

Is This Answer Correct ?    0 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c++ hiding?

616


What is a memory leak c++?

585


How a pointer differs from a reference?

687


Explain what you mean by a pointer.

620


Which programming language is best to learn first?

577






What does catch(…) mean?

608


Is vector a class in c++?

592


What is the function of I/O library in C++ ?

655


Write bites in Turbo c++ Header ("Include") Files.

676


What is scope operator in c++?

558


How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?

579


How static variables and local variablesare similar and dissimilar?

553


What do you mean by const correctness?

622


Write a Program to find the largest of 4 no using macros.

576


Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.

783