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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does 4d mean in c?

1504


What is Dynamic memory allocation in C? Name the dynamic allocation functions.

1417


What is the purpose of the preprocessor directive error?

1276


What do you understand by friend-functions? How are they used?

1210


What is the correct declaration of main?

1214


Write a program to print factorial of given number using recursion?

1019


List the difference between a 'copy constructor' and a 'assignment operator' in C?

1092


Explain how can I convert a number to a string?

1153


If you know then define #pragma?

1108


Is it fine to write void main () or main () in c?

1031


How is a structure member accessed?

1135


I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.

2237


What is malloc and calloc?

1058


write a program to rearrange the array such way that all even elements should come first and next come odd

2280


What is pass by reference in functions?

849