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

How is data hiding achieved in c++?

1077


What is the difference between mutex and binary semaphore?

1209


What is the type of this pointer in c++?

1062


How does java differ from c and c++?

995


What is the size of a vector?

1135


How to tokenize a string in c++?

1056


Can we change the basic meaning of an operator in c++?

1114


Can I learn c++ in a week?

1064


What is the purpose of ios::basefield in the following statement?

1253


declare an array of structure where the members of the structure are integer variable float variable integer array char variable access all elements of the structure using dot operator and this pointer operator

2344


How many characters are recognized by ANSI C++?

1418


write a corrected statement in c++ so that the statement will work properly. x = y = z + 3a;

1892


What do you mean by ‘void’ return type?

1054


Explain terminate() function?

1049


Can I learn c++ without c?

1144