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 methods of exporting a function from a dll?

1219


What do you know about near, far and huge pointer?

1136


What is anonymous object in c++?

1093


Describe private, protected and public?

1075


Can we inherit constructor in c++?

1084


How come you find out if a linked-list is a cycle or not?

1031


What is the full form of india?

1121


What is the use of setprecision in c++?

1008


Describe the advantage of an external iterator.

1038


What is std namespace in c++?

1169


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

1105


What is long in c++?

1243


Does c++ support exception handling?

1061


What is difference between c++ and c ++ 14?

1043


Explain the properties and principles of oop.

1021