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

Answers were Sorted based on User's Feedback



how to swap two numbers with out using temp variable..

Answer / dd

a=1
b=2
a=a+(b-a)
b=(a+b)-b

Is This Answer Correct ?    12 Yes 16 No

how to swap two numbers with out using temp variable..

Answer / kusum

if (a>b)
temp=a;
a=b;
b=temp;

Is This Answer Correct ?    0 Yes 21 No

Post New Answer

More C++ General Interview Questions

What is capacity in vector in c++?

0 Answers  


How did c++ start?

0 Answers  


what are Access specifiers in C++ class? What are the types?

0 Answers  


Is there anything you can do in C++ that you cannot do in C?

1 Answers  


Is rust better than c++?

0 Answers  


What is volatile and pragma? When they are used?

1 Answers  


What is c++ manipulator?

0 Answers  


If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

0 Answers  


what are the iterator and generic algorithms.

0 Answers  


What is the difference between public and private data members?

0 Answers  


Can inline functions have a recursion? Give the reason?

3 Answers  


Describe private, protected and public?

0 Answers  


Categories