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 / guest

using xor technique is much faster than using addition and
subtraction process , and xor instruction is much simpler at
processor level.

so be simply

x = x xor y
y = x xor y
x = x xor y

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c language used for?

988


Write a program to check armstrong number in c?

1132


What is break in c?

1049


#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }

1123


Explain the advantages and disadvantages of macros.

1105


What is quick sort in c?

1093


How to explain the final year project as a fresher please answer with sample project

977


Which built-in library function can be used to match a patter from the string?

1303


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

2390


What is the use of #define preprocessor in c?

1081


What type is sizeof?

1039


What is the size of array float a(10)?

1144


What is the difference between exit() and _exit() function?

1047


Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

2060


what do you mean by enumeration constant?

1014