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

write a corrected statement so that the instruction will work properly. if (4 < x < 11) y = 2 * x;

0 Answers  


How do you link a C++ program to C functions?

4 Answers  


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

0 Answers  


What are the types of array in c++?

0 Answers  


What is the latest version on c++?

0 Answers  


How do you master coding?

0 Answers  


How do you test your code?

4 Answers   Microsoft,


Define namespace in c++?

0 Answers  


Evaulate: 22%5 a) 2 b) 4 c) 0

0 Answers  


What is data abstraction? How is it different from data encapsulation?

0 Answers  


Which bit wise operator is suitable for checking whether a particular bit is on or off?

0 Answers  


What does return 0 do in c++?

0 Answers  


Categories