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 events occur in intr activated on interrupt vector table
What is the use of bit fields in structure declaration?
What header file is needed for exit(); a) stdlib.h b) conio.h c) dos.h
What is data type in c++?
Is c++ a low level language?
What does obj stand for?
What is the auto keyword good for in c++?
What are c++ storage classes?
What is the first name of c++?
Define basic type of variable used for a different condition in C++?
What are the new features that iso/ansi c++ has added to original c++ specifications?
What is a .lib file in c++?
Differentiate between an external iterator and an internal iterator?
what are the iterator and generic algorithms.
Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers