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 the static storage classes in c++.
What are static member functions?
What is long in c++?
What are the advantages of inheritance in c++?
Explain differences between new() and delete()?
Explain the benefits of proper inheritance.
What are the four partitions in which c++ compiler divides the ram?
What is pointer to array in c++?
Why pointer is used in c++?
Which c++ operator cannot overload?
Write a program to find the Fibonacci series recursively.
What is == in programming?
which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?
what are function pointers?
What are the rules for naming an identifier?