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
Why is main function important?
program explaining feautures of c++
What is the use of setprecision in c++?
Which bit wise operator is suitable for turning off a particular bit in a number?
how to explain our contribution in the project?
Which programming language should I learn first?
What is a storage class?
Is c++ an oop?
State the difference between delete and delete[].
What are keywords in c++?
What is istream and ostream in c++?
Which should be more useful: the protected and public virtuals?
What is the standard template library (stl)?
How do you establish a has-a relationship?
Which function cannot be overloaded c++?