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 / pranav

//swaping of 2 numbers without using temp variable
//a=5 & b=6
a=a+b; //a=30
b=a-b; //b=5
a=a-b; //a=6

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does the ios::ate argument do?

1205


Explain the properties and principles of oop.

1039


How to declare an array of pointers to integer?

1164


Is c++ high level programming language?

1148


Explain about Virtual Function in C++?

1037


How can you link a c++ program to c functions?

1114


program explaining feautures of c++

2454


What is an incomplete type in c++?

1296


What is the difference between a reference and a pointer?

1128


What is a hashmap c++?

1132


Of the numbers 12 23 9 28 which would be at the top of a properly implemented maxheap a) 28 b) 9 c) Any of them could be

1430


Is arr and &arr are same expression for an array?

1071


Why was c++ made?

1118


Can a new be used in place of old mallocq? If yes, why?

1105


How would you use the functions sin(), pow(), sqrt()?

1205