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...

How do we swap or interchange any 2 numbers without using
Temporary variable...Anybody can pls answer it.. Thanks in
Advance

Answer Posted / raghuram.a

int x,y;

x =x-y;
y =y+x;
x =y-x;

or

int x,y;

x=x^y;
y=x^y;
x=x^y;

Is This Answer Correct ?    11 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is header file in c?

1038


what is the function of pragma directive in c?

1080


What is build process in c?

1097


Explain which function in c can be used to append a string to another string?

1057


Explain high-order bytes.

1076


what is recursion in C

1035


Explain the properties of union. What is the size of a union variable

1145


What are the functions to open and close file in c language?

1147


Why is sprintf unsafe?

1010


Write a code to remove duplicates in a string.

992


What is the condition that is applied with ?: Operator?

1088


Give me the code of in-order recursive and non-recursive.

1335


What is difference between function overloading and operator overloading?

1061


What is meant by operator precedence?

1104


Write a program of advanced Fibonacci series.

1111