Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

what are the events occur in intr activated on interrupt vector table

1758


What is the use of bit fields in structure declaration?

987


What header file is needed for exit(); a) stdlib.h b) conio.h c) dos.h

1057


What is data type in c++?

1017


Is c++ a low level language?

972


What does obj stand for?

1177


What is the auto keyword good for in c++?

1192


What are c++ storage classes?

1105


What is the first name of c++?

1071


Define basic type of variable used for a different condition in C++?

1145


What are the new features that iso/ansi c++ has added to original c++ specifications?

1145


What is a .lib file in c++?

1000


Differentiate between an external iterator and an internal iterator?

999


what are the iterator and generic algorithms.

2171


Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers

1055