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

Explain abstraction.

1033


Explain the isa and hasa class relationships.

991


What is class invariant in c++?

1165


What is the object serialization?

1093


What are the advantages of using friend classes?

1082


What are the advantages of pointers?

1014


Describe public access specifiers?

1038


Explain the concept of dynamic allocation of memory?

1044


What is the difference between public, private, and protected access?

1010


What is the best c++ book?

1212


How long does it take to get good at leetcode?

1117


Why is c++ difficult?

989


Do the parentheses after the type name make a difference with new?

1035


What is binary search in c++?

976


How do you invoke a base member function from a derived class in which you’ve overridden that function?

1064