Write a program to swap 2 chars without using a third
varable?
char *s = "A";
char *p = "B";
Answer Posted / rajesh rvp
#include <stdio.h>
int main ()
{
int i;
char c,d,temp;
scanf("%c %c",&c,&d);
If (toascii (c)>toascii (d))
{
temp=c;
c=d;
d=temp;
}
return 0;
}
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Tell me what are static member functions?
What are the differences between java and c++?
What's the order in which the local objects are destructed?
Show the declaration for a static function pointer.
What is the use of this pointer in c++?
What doescout<<(0==0) print out a) 0 b) 1 c) Compiler error: Lvalue required
What is the use of function pointer?
Explain the use of vtable.
Why do we need constructors in c++?
Draw a flow chart and write a program for the difference between the sum of elements with odd and even numbers. Two dimensional array.
Why use of template is better than a base class?
How does list r; differs from list r();?
How does c++ structure differ from c++ class?
Why are pointers not used in c++?
What is a sequence in c++?