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 to swap two numbers with out using temp variable

Answer Posted / guest

another way is using bitwise XOR (^).

a=9; //a=1001
b=5; //b=0101

a=a^b; //a=1100
b=a^b; //b=1001
a=b^a; //a=0101

Is This Answer Correct ?    29 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is boyce codd normal form in c++?

1101


How to defines the function in c++?

1050


What is an html tag?

1076


What parameter does the constructor to an ofstream object take?

1003


Who invented turbo c++?

1016


What is the latest c++ version?

1051


Does c++ have a hash table?

943


What is the rule of three?

946


What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator?

1059


Does c++ cost money?

951


how to access grid view row?

2167


How do you flush a buffer in c++?

1057


What would happen on forgetting [], while deallocating an array through new?

1029


What do you understand by a pure virtual member function?

938


How are the features of c++ different from c?

1015