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

if a=10& b=20

a=a+b //a=30
b=a-b //b=10
a=a-b //a=20

finally we got a=20,b=10

Is This Answer Correct ?    10 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the identity function in c++? How is it useful?

1010


Why pointer is used in c++?

1110


What are friend classes? What are advantages of using friend classes?

1072


What is the main function c++?

1088


What are references in c++? What is a local reference?

1008


What are the classes in c++?

1081


How can an improvement in the quality of software be done by try/catch/throw?

1029


What is the difference between set and map in c++?

1115


write a function signature with various number of parameters.

1009


How do you show the declaration of a virtual constructor?

916


What data encapsulation is in c++?

1087


How to implement is-a and has-a class relationships?

982


What is the purpose of templates in c++?

1003


Why c++ is created?

969


What do you mean by global variables?

1055