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 do we swap or interchange any 2 numbers without using
Temporary variable...Anybody can pls answer it.. Thanks in
Advance

Answer Posted / srikanth

int x,y;

x =x-y;
y =y+x;
x =y-x;

or

int x,y;

x=x^y;
y=x^y;
x=x^y;

or

int x,y;
x*=xy;
y=x/y;
x=x/y;

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are header files and what are its uses in C programming?

1260


Why do we use int main instead of void main in c?

1164


How can I rethow can I return a sequence of random numbers which dont repeat at all?

1201


What is the sizeof () operator?

1097


What are the advantages and disadvantages of pointers?

1080


Why is not a pointer null after calling free?

1035


Where static variables are stored in c?

1124


What are the 4 types of functions?

1072


What is meant by inheritance?

1120


Explain what is wrong with this program statement? Void = 10;

1277


write a program to find the given number is prime or not

4791


Do character constants represent numerical values?

1362


What’s a signal? Explain what do I use signals for?

1133


What does 3 periods mean in texting?

1084


WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER

1878