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

Describe the role of the c++ in the tradeoff of safety vs. Usability?

0 Answers  


What is a c++ vector?

0 Answers  


How can a struct in c++ differs from a struct in c?

0 Answers  


What is a breakpoint?

0 Answers  


Explain explicit container.

0 Answers  


Define a nested class.

0 Answers  


Explain how would you handle a situation where you cannot call the destructor of a local explicitly?

0 Answers  


Does c++ have arraylist?

0 Answers  


What is encapsulation in c++?

1 Answers  


Write some differences between an external iterator and an internal iterator?

0 Answers  


Write about the role of c++ in the tradeoff of safety vs. Usability?

0 Answers  


Write a corrected statement in c++ so that the statement will work properly. x =+ 7;

2 Answers  


Categories