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
Explain abstraction.
Explain the isa and hasa class relationships.
What is class invariant in c++?
What is the object serialization?
What are the advantages of using friend classes?
What are the advantages of pointers?
Describe public access specifiers?
Explain the concept of dynamic allocation of memory?
What is the difference between public, private, and protected access?
What is the best c++ book?
How long does it take to get good at leetcode?
Why is c++ difficult?
Do the parentheses after the type name make a difference with new?
What is binary search in c++?
How do you invoke a base member function from a derived class in which you’ve overridden that function?