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 is private, public and protected inheritance?

1033


Can we define a constructor as virtual in c++?

1065


Explain how overloading takes place in c++?

971


Explain linked list using c++ with an example?

1022


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

988


How does c++ structure differ from c++ class?

1054


What are static variables?

1083


How do I start a c++ project?

1002


What is c++ used for in games?

1100


What are disadvantages of pointers?

985


When should I use unitbuf flag?

969


What is operators in c++?

957


If there are two catch statements, one for base and one for derived, which should come first?

988


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create

2579


How do I download c++?

964