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

write a program to swap Two numbers without using temp variable.

Answer Posted / prasanna

Swapping two variables in a single line with no temporary
variable..

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

so.. simple..

Prasanna. (prasanna7287@yahoo.co.in)

Is This Answer Correct ?    351 Yes 140 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a string?

1052


What is const keyword in c?

1122


What are the 5 elements of structure?

1040


What is break in c?

984


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

1212


Explain do array subscripts always start with zero?

1174


What is the use of #include in c?

1036


Which is better pointer or array?

973


What is the difference between #include and #include 'file' ?

1001


Is stack a keyword in c?

1038


Explain how are portions of a program disabled in demo versions?

1073


What is the use of putchar function?

1007


What are run-time errors?

1054


If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402

3847


What is a static function in c?

1104