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...


wat are the two methods for swapping two numbers without
using temp variable??

Answers were Sorted based on User's Feedback



wat are the two methods for swapping two numbers without using temp variable??..

Answer / shrikantauti

i dont know the methods but can give the code to swap values without temporary variable.
a b
a=a+b
b=a-b
a=a-b

Is This Answer Correct ?    6 Yes 0 No

wat are the two methods for swapping two numbers without using temp variable??..

Answer / abhishek karnani

int a=10,b=5;

a=a+b-(b=a);

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More C Interview Questions

a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

0 Answers  


What is the purpose of #pragma directives in C?

2 Answers  


What is a newline escape sequence?

0 Answers  


What are the 5 types of inheritance in c ++?

0 Answers  


what are the various memory handling mechanisms in C ?

4 Answers   HP,


Is c language still used?

0 Answers  


What is a segmentation fault?

2 Answers  


Explain enumerated types.

0 Answers  


Explain how can I manipulate strings of multibyte characters?

0 Answers  


What does %c mean in c?

0 Answers  


Can a file other than a .h file be included with #include?

0 Answers   Aspire, Infogain,


What is the default value of local and global variables in c?

0 Answers  


Categories