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
What are the methods of exporting a function from a dll?
What do you know about near, far and huge pointer?
What is anonymous object in c++?
Describe private, protected and public?
Can we inherit constructor in c++?
How come you find out if a linked-list is a cycle or not?
What is the full form of india?
What is the use of setprecision in c++?
Describe the advantage of an external iterator.
What is std namespace in c++?
How do you invoke a base member function from a derived class in which you’ve overridden that function?
What is long in c++?
Does c++ support exception handling?
What is difference between c++ and c ++ 14?
Explain the properties and principles of oop.